javascript - How to get Var inside onclick function? -
i have 2 variables outside. want display 2 variable values inside onclick event.. cant able value using below code.. please me solve issue. have fix issue in 3 hours.
var mycode = "12345"; var mycount = "5" $('.cols2.continue').html('<a href="#" onclick="test.element='mycode, mycount ';test.elemname=+mycode +;">browse</a>');
now, m getting variable name in place of value.
thanks
your jquery
var mycode = "12345"; var mycount = "5" $('.continue').html('<a href="#" onclick="test.element=''+mycode+', '+mycount+' ';test.elemname='+mycode+ ';">browse</a>');
Comments
Post a Comment