Difference between revisions of "Event Handlers"

From rbachwiki
Jump to navigation Jump to search
(Created page with "==Event Handlers== <pre> var p = document.createElement('P'); p.textContent = "A new Paragraph"; p.style.fontSize = '17px'; var li= document.querySelectorAll('li')[1]; li.appe...")
 
Line 30: Line 30:
</pre>
</pre>
==Event Listeners==
==Event Listeners==
==[[#top|Back To Top]]-[[Main_Page| Home]] - [[Java Script|Category]]==

Revision as of 20:09, 25 October 2016

Event Handlers

var p = document.createElement('P');
p.textContent = "A new Paragraph";
p.style.fontSize = '17px';
var li= document.querySelectorAll('li')[1];
li.appendChild(p);
var a = document.querySelector('a');
var h1 = document.querySelector('h1');
a.onmouseover = function(){
  h1.textContent = "Outwater Plastics Industries";
};
a.onmouseout = function(){
  h1.textContent = "Outwater";
};

HTML

<body>
<h1>Outwter</h1>
  <ul>
    <li><a href="#">Link 1</a></li>
    <li><a href="#">Link 2</a></li>
  </ul>
</body>

Event Listeners

Back To Top- Home - Category