Till now we’ve looked at two important methods, the alert() method of the window object and write() of document object. You’ve also seen how text or numbers can be passed to these methods.
document.write("Your name is " + vis_name);
alert("Welcome " + vis_name + "\nHow are we today?");
Remember, a variable should be placed outside the quotes to display its value.
Ashton Kutcher, the famous Hollywood actor, became the first person on Twitter to have a million followers. As of August 2017, he has 18.7 million followers. [more...]