$("#myInput").val(); //use this to retrieve the value of an element. meaning an element that has: value=""
$("#myInput").val("myNewValue"); // use this to set the value of an element.

I chose to use IDs for my selector above but you could easily use a class for the selector. Check out the selector documentation <http://docs.jquery.com/DOM/Traversing/Selectors> for more info.

...and the relevant html for the above code would be:

<input id="myInput" type="text" name="someName" value="">

Hope that helps.

Cheers,
Chris

jquery newbie wrote:
hi - i need to implement del.icio.us style tagging mechanism. that
involves a list of hyperlinked keywords that when clicked add or
remove or their text to an inputbox and inputbox supporting
autosuggest for each of the words after the separation character. i am
surprised to see that it is not already implemented since most web 2.0
applications implement one form of tagging or another. if someone can
tell me how to add or remove a text to an input field using jquery, i
can get the ball rolling. thanks.



--
http://www.cjordan.us

Reply via email to