I need help with my function. I dont know how to set right text into val() function.
I have form, where I write text which I want to passing via val
<form>
<input type="text" id="formValueId" name="valueId"/>
<input type="button" id="theButton" value="Send"/>
</form>
And here is the javascript:
var button = document.getElementById("theButton"),
value = button.form.valueId.value;
button.onclick = function() {
$("#modal").fadeOut(400, function() {
$("#bg").fadeOut(400, function() {
$theTarget.val("My inserted text should be here"); //Before here were (value)
});
});
}
It's continue of this - jQuery selector - inserting value only to selected id Thanks