Phpinterviewquestion - phpinterviewquestion.com - Interview Questions

Latest News:

How to change background color in Javascript through function? 2 Nov 2011 | 11:51 pm

Example: Code: <html> <head> <script type="text/javascript"> function changecolor(color_code) { document.bgColor=color_code; } </script> </head> <body> </body> </html>

How to replace a specified value with another value in javascript? 18 Oct 2011 | 11:43 pm

Example: Code: <html> <body> <script type="text/javascript"> { var txt="Shane Watson"; document.write(txt.replace("Watson","Harwood")); } </script> </body> </html> Output: Shane Harwood

How to convert a String into uppercase in javascript? 18 Oct 2011 | 11:34 pm

Example: Code: <html> <body> <script type="text/javascript"> { var txt="JOHN"; document.write(txt.toLowerCase()); } </script> </body> </html> Output: john

How to convert a string into Uppercase in Javascript? 18 Oct 2011 | 11:31 pm

Example: Code: <html> <body> <script type="text/javascript"> { var txt="John"; document.write(txt.toUpperCase()); } </script> </body> </html> Output: JOHN

How to get string length in javascript? 18 Oct 2011 | 11:21 pm

Example: Code: <html> <body> <script type="text/javascript"> { var txt="John"; document.write(txt.length); } </script> </body> </html> Output: 4

How to write for loop in javascript? 17 Oct 2011 | 11:33 pm

Example: Code: var a=1; for (a=1;a

How to write if statement in javascript? 16 Oct 2011 | 12:44 am

var a=11; if (a>10) { document.write(a); } Output: 11

How to declare a variable in javascript? 16 Oct 2011 | 12:27 am

You can create JavaScript variables with the var keyword, as follows: <script type="text/javascript"> var a; var name; </script> After the declaration , the variables are empty (they have no values). ...

How to add string and number in javascript? 16 Oct 2011 | 12:11 am

Example: Code: <html> <body> <script type="text/javascript"> var a; a=10+10; document.write(a); document.write(""); a="10"+"10"; document.write(a); document.write(""); a=10+"10"; document.write(a); do...

How to print in Javascript ? 15 Oct 2011 | 10:39 pm

<html> <body> <script type="text/javascript"> { document.write("<h1>This is a heading</h1>"); document.write("<p>Hello.</p>"); document.write("<p>World.</p>"); } </script> </body> </html> OutPut: This...

Recently parsed news:

Recent searches: