User:Abigalekim/common.js

//alert to greet the user, using the username of the user alert("Hello, " + $("#pt-userpage > a").text + "! It is nice to see you on the page " + $("#firstHeading").text + ".");

//shows the number of paragraphs in an article var pCount = $("p").length; var $output = $(" Number of paragraphs: " + pCount + " ").css("font-size", "large"); $( "#bodyContent" ).prepend($output);

//shows the word count of an article var a = $("#bodyContent").text; var wCount = a.split(" ").length; var $wordOutput = $(" Word Count: " + wCount + " ").css("font-size", "large"); $("#bodyContent").prepend($wordOutput);

// Browse on Wikipedia, and find any article of your choice. // You can also refresh the next tab (a Wikipedia page on "Mathematics"). // An alert greeting you with your username will pop up. // You will also find that each article has a paragraph count and a word count at the top of the article. // Thank you for participating in this demo!