QA Graphic

Remove() Function

Simple way to replace DOM elements

This simple function is useful when you want to remove an element from the document.

Sample Query

$(".legal").remove();

This would remove any element that has the words "legal" in the class name.

This would be useful if you are taking screenshots and want to remove certain parts. Also useful for QA to test "hacking" functionality.

Fun Tricks to Try

Remove All Images

This removes all the images on the page:

$("img").remove();

Remove All Anchor

This removes all the anchor tags and text on the page:

$("a").remove();

 

About

jQuery is the most popular Javascript library on the Internet. Chances are that websites that your testing use it. These posts are all about tips and tricks for QA testing.

Schedule

SaturdayInternet Tools
SundayOpen Topic
MondayMedia Monday
TuesdayQA
WednesdayAffinity
ThursdayBBEdit
FridayMacintosh