jquery - Get value from one click event to other event in JavaScript -


i have code written other this.

<button onclick="javascript:confirm("are sure?");" id="confirm_button"/> 

now, add more functionality button attaching 1 click event same button

$("#confirm_button").live("click",function(event){  //need value confirm box. //code goes here. }); 

how value first event in event listener? need if code work. 1 way have move confirm box click event listener, requirements don't allow me. thanks

you can declare global variable , store value ion that,so can used in other functions

somewhat this

<script> //global variable here var testvariable;  function1 { //initalize value here }  function2 { //use here }  </script> 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -