You can read here about the behaviour of attributes in many different browsers, including IE.
element.setAttribute()
should do the trick, even in IE. Did you try it? If it doesn’t work, then maybe
element.attributeName="value"
might work.
More Related Contents:
- 5 stars and the golden 5 stars are not together (When browsing with Internet explorer)
- Get the size of the screen, current web page and browser window
- contenteditable, set caret at the end of the text (cross-browser)
- Browser detection versus feature detection
- OnChange event handler for radio button (INPUT type=”radio”) doesn’t work as one value
- How is the default submit button on an HTML form determined?
- Show datalist labels but submit the actual value
- Jquery load() only working in firefox?
- Is there a way to make text unselectable on an HTML page? [duplicate]
- Prevent zoom cross-browser
- How to make Internet Explorer emulate pointer-events:none?
- textarea character limit
- Close Current Tab
- Enter key press behaves like a Tab in Javascript
- How do I change the ID of a HTML element with JavaScript?
- IE8 alternative to window.scrollY?
- Setting minimum size limit for a window minimization of browser?
- Is there any problem with using HTML5’s “data-*” attributes for older browsers?
- How to make an HTML element editable cross-browser?
- How to detect supported video formats for the HTML5 video tag?
- Testing for multiple screens with javascript
- Retrieving HTML attribute values “the DOM 0 way”
- Use JavaScript to intercept all document link clicks
- Cross-browser innerText for setting values
- How to autosize a textarea using Prototype?
- How to use external “.js” files
- What is the best way to parse html in google apps script
- Why write when the mime type is set by the server?
- Selecting multiple from an html select element without using ctrl key
- Anchor tag download attribute not working :Bug in Chrome 35.0.1916.114