.onclick
should be set to a function instead of a string. Try
elemm.onclick = function() { alert('blah'); };
instead.
More Related Contents:
- How do I create an HTML element with attributes and events using JavaScript?
- How may I reference the script tag that loaded the currently-executing script?
- JavaScript: remove event listener
- What is the difference between the mouseover and mouseenter events?
- Difference between “change” and “input” event for an `input` element
- Resize event for textarea?
- Trigger an event with Prototype
- Jquery: change event to input file on IE
- Javascript with jQuery: Click and double click on same element, different effect, one disables the other
- jQuery counting elements by class – what is the best way to implement this?
- Can the unload Event be Used to Reliably fire ajax Request?
- Getting DOM element value using pure JavaScript
- Change observable but don’t notify subscribers in knockout.js
- Is there any other way to implement a “listening” function without an infinite while loop?
- jQuery prevent change for select
- adding event listener cross browser [closed]
- Detect double tap on ipad or iphone screen using javascript
- Monitor all JavaScript events in the browser console
- How to clone or re-dispatch DOM events?
- How can I stop an onclick event from firing for parent element when child is clicked?
- List all javascript events wired up on a page using jquery
- How to set DOM element as first child?
- JavaScript add events cross-browser function implementation: use attachEvent/addEventListener vs inline events
- Listen for changes with localStorage on the same window
- Angular2 – catch/subscribe to (click) event in dynamically added HTML
- Angular 2 Hover event
- Is there an equivalent to e.PageX position for ‘touchstart’ event as there is for click event?
- How to implement a lock in JavaScript
- Fire oninput event with jQuery
- Javascript Event Handler for Print