esandra Posted December 10, 2010 Share Posted December 10, 2010 I want to have an array wherein I could push values every time the function is triggered when this button is clicked <img src="images/del.png" width="15" height="15" onclick="hide(<?php echo $y;?>)"> this will be called function hide(y){ y=y-1 var line="line"+y document.getElementById(line).style.display="none" //the array is supposed to be in here to record the values of all the $y that ever called this function } Quote Link to comment https://forums.phpfreaks.com/topic/221182-push-element-in-array/ Share on other sites More sharing options...
requinix Posted December 10, 2010 Share Posted December 10, 2010 A JavaScript array? var yvalues = []; function hide(y) { // ... yvalues.push(y); } Quote Link to comment https://forums.phpfreaks.com/topic/221182-push-element-in-array/#findComment-1145229 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.