Designing solutions through programming - January 16 2017 Lesson Notes
From Computer Science Wiki
Revision as of 11:56, 16 January 2017 by Mr. MacKenty(talk | contribs)(Created page with " __NOTOC__ <table cellspacing="10" style="width:100%;"> <tr> <td style="width:50%; margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1...")
you will use the following code snippets to START exploring javascript:
<!DOCTYPE html><html><body><h1>A javascript example</h1><pid="demo1">JavaScript can change content inside a defined ID or even CLASS.</p><buttontype="button"onclick="document.getElementById('demo1').innerHTML = 'I love computer science!'">Click Me!</button></body></html>
<!DOCTYPE html><html><body><p>This example demonstrates how to assign an "onmouseover" and "onmouseout" event to a h1 element.</p><h1id="demo"onmouseover="mouseOver()"onmouseout="mouseOut()">Mouse over me</h1><script>functionmouseOver(){document.getElementById("demo").style.color="red";}functionmouseOut(){document.getElementById("demo").style.color="black";}</script></body></html>