change value of input element!

Posted by Lina on Stack Overflow See other posts from Stack Overflow or by Lina
Published on 2010-05-03T13:13:45Z Indexed on 2010/05/03 13:18 UTC
Read the original article Hit count: 165

Filed under:
|
|

is it able to "override/overwrite" an input element fixed value using javascript and/or jquery?

i.e. if i have an input element like this:

<div id="myDiv">
    <input type="text" name="inputs" value="someValue" />
</div>

is it possible to make a jquery object of that element and then change its value to something else then rewrite the jquery object to the dom?? i'm trying but obviously i haven't got good results!

i've been trying something like this:

$('input').val("someOtherDynamicValue");
var x = $('input');
$("#myDiv").html(x);

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript