

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
innerHTML adds text but not HTML tags
Maybe, you are using += with innerHTML. Try the following:
var myNum = [1,2,3]; var myStr; myStr = "<ul>"; for( var a in myNum) myStr += "<li>" + a + "</li>"; myStr += "</ul>"; id("numberList").innerHTML = myStr;
- Related Questions & Answers
- HTML DOM innerHTML Property
- HTML Deprecated Tags
- How do you make a button that adds text in HTML <input>?
- what are html tags?\n\n
- STR_TO_DATE as column, but column not found?
- Remove and add new HTML Tags with JavaScript?
- HTML Text Formatting
- Are HTML comments inside script tags a best practice?
- What are the essential tags for an HTML Document?
- Are button HTML tags outside of a form valid?
- innerHTML vs innerText in JavaScript.
- Set the innerHTML with JavaScript
- PHP Tags
- Internet Explorer 8 will not modify HTML5 tags in print stylesheet
- Is there a PHP function that only adds slashes to double quotes NOT single quotes
Advertisements