简体   繁体   中英

How To Use Javascript Variable In html attribute string

I am New to This

I am writing this code

"OnClientClick="return OpenRadWindow('ImportSDS.aspx?id=##', 'RWImport');" >

i have js variable var id = "<%=this.id %>";

So I want to Use This id Varable at ## How It Is Possible Please Help.

If you have the variable available, you should just use it in the method instead.

I don't have enough of your code really to go on but something like this.

function OpenRadWindow(url, x) { 
   var id = "<%= this.id %>";
   url = url + id;
   ... then your code here
}

Then for your OnClientClick

OnClientClick="return OpenRadWindow('ImportSDS.aspx?id=', 'RWImport');"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM