How to work with DOM.
See original GitHub issueIs it possible to using something like this?
<% var bt = document.getElementById("page2");
bt.addEventListener('click',function(){
alert("123")}); %>
thanks for reply.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Introduction to the DOM - Web APIs | MDN
The Document Object Model (DOM) is a programming interface for web documents. It represents the page so that programs can change the document ......
Read more >The DOM Explained for Beginners - freeCodeCamp
The DOM is a top down representation of all the elements that make up a web page. It's the interface through which your...
Read more >JavaScript HTML DOM - W3Schools
The DOM is a W3C (World Wide Web Consortium) standard. The DOM defines a standard for accessing documents: "The W3C Document Object Model...
Read more >Understanding the DOM — Document Object Model
The Document Object Model, usually referred to as the DOM, is an essential part of making websites interactive. It is an interface that...
Read more >What is a DOM element in JavaScript? How does it work?
Document Object Model or DOM is an interface that defines how the browser reads your XML or HTML document. JavaScript is allowed to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This isn’t how EJS works. To use it on the client side, you would do something like:
Of course you would use something other than
document.write
.Includes are not natively supported on the client side.
Warning: Doing complex EJS logic on the client side can get very messy since JS support for multi-line strings isn’t very good. (This doesn’t apply if you are getting your EJS templates from an external file via AJAX.)
ok,I found that I can using html = new EJS({url: ‘/template.ejs’}).render(data)
on client side