Blog Archives

You can learn here basics about javascript.

JavaScript tagName

It returns the name of the element. Consider below example, <script type="text/javascript"> function gettagname() { var name_element = document.getElementById('txt_name'); alert("I am a " + name_element.tagName + " element") } </script> <input type="text" name="name" id="txt_name" value="learn web development"> <input type="button" value="Get

Posted in Javascript

JavaScript getElementById

Accessing Form Elements using getElementById In order to access the form element, we can use the method getElementById() like this: var name_element = document.getElementById(‘txt_name’); Here txt_name is id of any form fields. Consider this form input element, <input type=”text” name=”name”

Posted in Javascript Tagged with:

JavaScript Window.Location

The window.location() is used to know the current page name (current url) and also used to redirect to new url. If you want to redirect all your visitors to site when they arrived at your site, you would just

Posted in Javascript Tagged with:

Javascript popup

In JavaScript you can create three kinds of popup boxes: Alert box, Confirm box, and Prompt box. Alert Box An alert box is often used if you want to know input from user. When an alert box pops up, the

Posted in Javascript Tagged with:

JavaScript document.write

document.write() – This simply prints the specified text to the HTML page. To print text literally, enter the text in single quote marks inside parentheses like so: Syntax: document.write(‘Learn web development!’); Example: <html> <body> <h1> <script type=”text/javascript”> document.write(‘Learn web development!’);

Posted in Javascript Tagged with:

JavaScript Tutorial – What is JavaScript ?

What is JavaScript ? JavaScript is a client-side scripting language. This means the web surfer’s browser will be running the script. JavaScript is not a stand-alone language, but rather a scripting add-on to HTML. JavaScript is added to HTML commands

Posted in Javascript Tagged with: