Can't seem to change value of text input with jQuery -


If I have a specific function nearby, I want to change the value of a text input with jQuery. I used this code:

  $ ('# find'). Attr ("value", "newvalue");  

But this is not changing it is the markup of the input that I want to change:

    

I know that this code is going to take this pie because it executes and works both sides of jQuery.

Any help would be appreciated, thanks.

  $ ("# find"). Val ("newvalue");  

Not sure why your job does not work though. You may also need the name attribute on the input? It is not certain if this is the case ...

This can also be done even before the input becomes in what case it wraps in

  $ (document) .ready (function () {// want to do anything, when you are all of the elements once.});  

Or stick to script block after element in your source (this can be a controversial suggestion).


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -