I have the following JavaScript that creates a div and then appends it to the body and then inserts some dynamically generated HTML into it. cartDiv = document.createElement
You can add the id="MyID123" at the start of the cartHTML text appends.
id="MyID123"
The first line would therefore be:
var cartHTML = ''; -OR- If you want the ID to be in a variable, then something like this: var MyIDvariable = "MyID123"; var cartHTML = ''; /* ... the rest of your code ... */ 0 讨论(0) 查看其它6个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
-OR-
If you want the ID to be in a variable, then something like this:
var MyIDvariable = "MyID123"; var cartHTML = ''; /* ... the rest of your code ... */ 0 讨论(0) 查看其它6个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复