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=&#39;mycode, mycount &#39;;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=&#39;'+mycode+', '+mycount+' &#39;;test.elemname='+mycode+ ';">browse</a>'); 

jsfiddel


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -