javascript - How can I put click event inside a click event jquery? -


if user click first button, second button show up, , if user click second button, action called. how can achieve this? appreciate.

$('first_click').on('click',function(){  //second_click button show , action here  	$('second_click').on('click',function(){        alert('ok');        });      });

try this:

'use strict'  $(function() {      var $button1 = $('#button1');     var $button2 = $('#button2');      $button2.hide();      $button1.on('click', function() {        $button1.hide();        $button2.show();     });      $button2.on('click', function() {         // action...     }); })(); 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -