html - Passing javascript variable to popup DIV -
i have html main page div popup. when user click button in main html page, hidden value collected javascript. , javascript open popup. can value collect javascript sent popup?
in following code, value apple need display echo $abcd.
<div class="pages"> <input type="button" name="addquestion" value="click" /> <input type="hidden" value="apple" name="cellname" /> <div> <div class="popup" id="popupid"> <?php echo $abcd; ?> <div>
java script
var cell = document.getelementsbyname("cellname"); (var = 0; < cell.length; i++) { cell[i].strcell = cell[i].value; cell[i].onclick = popupmenu; } function popupmenu() { var abcd = this.strcell; // need send value popup div. document.getelementbyid("popupid").style.display = 'block'; }
Comments
Post a Comment