I understand this is an easy question but for some reason this just isn't working for me. I have a function that is triggered everytime a drop down menu is changed. Here is the relevant code that is suppose to grab the current value of the text field, if a value exists, clear it that is contained within the .change function:
var doc_val_check = $('#doc_title').attr("value");
if (doc_val_check.length > 0) {
doc_val_check == "";
}
I feel like I am missing something very simple.
If you want to have element with visible blank text just do this:
If you want to clear the text field, use:
What you need is:
We can use this for text clear
For the most part you just set the .val() method. All of the answers are pretty accurate, just wanted to post my results to anyone who may need to set the value via the client id that gets rendered.
Instead of all those: