•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,231 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,200 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1094 | Replies: 2
![]() |
•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,161
Reputation:
Rep Power: 7
Solved Threads: 58
it allows you to dynamically inject a string of HTML markup into the Document Object Model using JavaScript.
•
•
Join Date: Dec 2007
Location: www.JavaScriptBank.com
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 1
The innerHTML property is valid for both block and inline elements. By definition, elements that do not have both an opening and closing tag cannot have an innerHTML property.
The innerHTML property takes a string that specifies a valid combination of text and elements.
When the innerHTML property is set, the given string completely replaces the existing content of the object. If the string contains HTML tags, the string is parsed and formatted as it is placed into the document.
This property is accessible at run time, as of Microsoft® Internet Explorer 5. Removing elements at run time, before the closing tag is parsed, could prevent other areas of the document from rendering.
When using innerHTML to insert script, you must include the DEFER attribute in the script element.
You can change the value of the title element using the document .title property.
To change the contents of the table , tFoot , tHead , and tr elements, use the table object model described in How to Build Tables Dynamically . For example, use the rowIndex property or the rows collection to retrieve a reference to a specific table row. You can add or delete rows using the insertRow and deleteRow methods. To retrieve a reference to a specific cell, use the cellIndex property or the cells collection. You can add or delete rows using the insertCell and deleteCell methods. To change the content of a particular cell, use the innerHTML property.
To maintain compatibility with earlier versions of Internet Explorer, this property applies to the textArea object. However, the property works only with strings that do not contain tags. With a string that contains a tag, this property returns an error. It is better to use the innerText property with this object.
The innerHTML property takes a string that specifies a valid combination of text and elements.
When the innerHTML property is set, the given string completely replaces the existing content of the object. If the string contains HTML tags, the string is parsed and formatted as it is placed into the document.
This property is accessible at run time, as of Microsoft® Internet Explorer 5. Removing elements at run time, before the closing tag is parsed, could prevent other areas of the document from rendering.
When using innerHTML to insert script, you must include the DEFER attribute in the script element.
You can change the value of the title element using the document .title property.
To change the contents of the table , tFoot , tHead , and tr elements, use the table object model described in How to Build Tables Dynamically . For example, use the rowIndex property or the rows collection to retrieve a reference to a specific table row. You can add or delete rows using the insertRow and deleteRow methods. To retrieve a reference to a specific cell, use the cellIndex property or the cells collection. You can add or delete rows using the insertCell and deleteCell methods. To change the content of a particular cell, use the innerHTML property.
To maintain compatibility with earlier versions of Internet Explorer, this property applies to the textArea object. However, the property works only with strings that do not contain tags. With a string that contains a tag, this property returns an error. It is better to use the innerText property with this object.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- HTML, CSS, JavaScript Developer (Web Development Job Offers)
- Sending HTML email via PHP mail function (PHP)
- Image capture into HTML/IE and Oracle databases... (Oracle)
- http://scrk.com/passthrough/index.html? HELP !!! (Web Browsers)
- Javascript/HTML problem!!! (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: FileUpload using ajax
- Next Thread: how to change the aligment of a textarea



Linear Mode