html body { margin-top: 50px !important; } #top_form { position: fixed; top:0; left:0; width: 100%; margin:0; z-index: 2100000000; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; border-bottom:1px solid #151515; background:#FFC8C8; height:45px; line-height:45px; } #top_form input[name=url] { width: 550px; height: 20px; padding: 5px; font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif; border: 0px none; background: none repeat scroll 0% 0% #FFF; }
Introduction To Java Script
Introduction To Java Script
About JavaScript
Statements in JavaScript resemble statements in Java, because both languages borrowed heavily from the C language
Notes:
The type attribute is to allow you to use other scripting languages (but JavaScript is the default)
Event Handling
CSS with Java Script
<div style="backgroundcolor:#D94A38;width:170px;height:80px;margin:20px;paddingtop:20px;color:#ffffff;font-weight:bold;font-size:18px;float:left;textalign:center;" onmouseover="this.innerHTML=Non Major Elective'" onmouseout="this.innerHTML='Mouse Over Me'">Offered by University Informatics Centre</div>
Click Event
<!DOCTYPE html> <html> <head> <script> function myfun(id) { id.innerHTML="<b><u><em>Click to draw an underline and make it Italic!</em></u></b>"; } </script> </head> <body> <h1 onclick="myfun(this)">Click to draw an underline and to make it Italic!</h1> </body> </html>
Form Handling
<!DOCTYPE html> <html> <head> <script> function ff() { var x=document.forms["sample"]["sname"].value; if (x==null || x=="") { alert("Student name must be filled out"); return false; } } </script>
<form name="sample" action="uuu.php" onsubmit="return ff()" method="post"> Student name: <input type="text" name="sname"> <input type="submit" value="Submit"> </form>
Q and A