I have been looking all over for a way to do this but most methods seem overly long or complex. I have a button and an invisible <div>, on the press of a button I would like text to be written into the <div> using jquery.
Say this is my html including the <div> element:
<button id="buttonid"></button>
<div id="invisible"></div>
My jquery would start something like this?
$(document).ready(function(){
$("#buttonid").click(function(){
//WHAT COMES HERE? TO ADD TEXT TO #invisible ?
});
});
Notes:
.show(), assuming that the div starts off as being not visible.html()instead of.text()if you’re planning to insert HTML markup instead of plain text.