i have a h3 tag
<h3> <a href="#"> Initial Text</a></h3>
and i have a TextBox. When a Some values is typed in that TextBox
<input id="Medication" name="Medication" size="50" type="text" value="">
The value in that anchor link (Initial Text)
Should be replaced with the Value in the TextBox.
How can i do that? can any one help me with this?
Thanks
Try:
$('#medication').blur(function(){
var objVal = $(this).val();
if(objVal != ''){
$('h3 a').text(objVal);
}
});
This will attach the blur() event handler to execute the provided function when the text box loses focus. The function will check if the value is set and if it is then it will update the text in your <a> tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With