javascript - html link to change the value of a textbox -
I am trying to create text in html, which is clicked once, the text box The value of the value changes is equal to the text that was clicked, can I do this anyway?
In other words, I want the functionality of a button (onClick event) for a link / text, for example: What's wrong with this?
& lt; Td> & Lt; Input type = "submit" name = "submit" value = & lt;% = text.toString ()% & gt; OnClick = "(<% TextBox1.Text = text.toString ()%>)" style = "background: none; border: 0; color: # ff0000" & gt; & Lt; / TD & gt; Assuming the input is an ID attribute with the value "foo":
Jquery like functions can make a bit easier:onclick = ". Document.getElementById ('foo') value = 'bar',"
$ ('#foo'). Attr ('value', 'bar');
Anyone can add this period to a span element, for example using
Comments
Post a Comment