Hi, how can I make a javascript that will erase a certain value in the text field after clicking it... Just like in this forums.. the username field has the username value.. after clicking it, it will be erase.. I know it's pretty easy, I just don't know how
Yes, it's easy: document.getElementById('YOUR_ELEMENT').value = ''; Example: <html> <body> <input id="c1" name="c1" maxlength="10" size="10" value=""/> <button type="button" onclick="JavaScript: alert(document.getElementById('c1').value ); document.getElementById('c1').value = '';">Test</button> </body> </html> Code (markup):
heya! thanks it works! hehehe.. im so stupid.. i should have viewed the source.. because i can see it, it's javascript. wahehehe thanks again! ^_^