Easy Tutorial
❮ Prop Document Documentelement Prop Style Borderimage ❯

HTML DOM innerHTML Property

Element Object


Definition and Usage

The innerHTML property sets or returns the HTML between the start and end tags of a table row.

Syntax


Browser Support

All major browsers support the innerHTML property.


Example

Change text, URL, and link target:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<script>
function changeLink(){
    document.getElementById('myAnchor').innerHTML="tutorialpro";
    document.getElementById('myAnchor').href="//www.tutorialpro.org";
    document.getElementById('myAnchor').target="_blank";
}
</script>
</head>
<body>

<a id="myAnchor" href="//www.microsoft.com">Microsoft</a>
<input type="button" onclick="changeLink()" value="Modify Link">

</body>
</html>

Element Object

❮ Prop Document Documentelement Prop Style Borderimage ❯