I have an h1
header on my page that simply says "Hello world".
I want to know how I can add a form to change the header to say "Hello world from my_form_field_value".
I have an h1
header on my page that simply says "Hello world".
I want to know how I can add a form to change the header to say "Hello world from my_form_field_value".
This question is horribly phrased so I'm afraid I will answer your question with other answers.
What I believe you want is on input change, you want to capture the change (Detecting input change in jQuery?) and update the h1 text: $("h1").text("newString");
(that will only work with jquery included)
It depends on the technology you are using (jQuery, ASP(.NET), PHP, etc).
user3047190's answer used jQuery (client side solution). If using a server side solution, you can have the form send a querystring containing the text to the server and return a page with the text you just typed in.
Here's an online example: http://html.net/tutorials/asp/lesson11_ex1.asp
Here's the tutorial explaining the above classic ASP example: http://html.net/tutorials/asp/lesson11.asp