remove type text from input field

L3TH4L

New Member
Note: I am new to Javascript.Here is code:it is from the html page itself\[code\]<form action="#" id="ToolKeywordSearch"> <input type="text" class="ProductFinderText" id="ToolSearchField"onblur="if(this.valuehttp://stackoverflow.com/questions/14500270/=='') {this.value='http://stackoverflow.com/questions/14500270/Enter Search Term';}" onclick="if (this.value =http://stackoverflow.com/questions/14500270/='Enter Search Term ') { this.valuehttp://stackoverflow.com/questions/14500270/= ''; }" value="http://stackoverflow.com/questions/14500270/Enter Search Term" /></form> ___________________________________| _____________________ ______ | (restriction does not let me insert image)| | |O | | ||| |enter search term | \| |Search|| | --------------------- ------ ||___________________________________|\[/code\]Here what it does: when search button is pressed it opens the search fieldthe search image is a background:\[code\]#ToolSearchField { background:url(../../Content/images/search_but.png) no-repeat scroll right center transparent;\[/code\]cursor:pointer; }How to remove the text in the search field? with Javascript or CSS, tried both but it wasn't successful. \[code\]<script type="text/javascript"> var jo = document.getElementById("ToolSearchField").value; alert(jo);</script>I receive Enter Search Term as an output. Then if I insert remove(); instead, it doesn't do anything.var jo = document.getElementById("ToolSearchField").value; jo.remove();\[/code\]The final result should have search button that launches the search action.Tell me please, what am I doing wrong.
 
Back
Top