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

script to use these events and special styles Using a script to set up is the best practice, so that they can work without.

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -