How to add local variables and a different function in script element in Javascript [closed]
- 阅读更多 关于 How to add local variables and a different function in script element in Javascript [closed]
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . I need to create a script element as below, <div class="abcd"> <script type="text/javascript"> var a = "10"; var b = "20"; (function(d) { //lines of code of the function }(document)); </script> </div> I have tried to complete these so by first creating a script element by document.Createelement