Tag Archives: javascript

Make jQuery library available to any webpage using Browser JavaScript Console

Hey there,

jQuery is a powerful & easy to use JavaScript library for DOM manipulation. You can do alot of activities in the HTML DOM with this awesome library. Normally I play with jQuery within the Browser Console (Using Firebug in Mozilla Firefox/Chrome Dev Tools in Google Chrome) So I can play inside HTML DOM using this library with one condition that JQuery has to be present in the webpage already. But in some cases, You might have noticed an unavailability of jQuery in some websites. So In that case, you can’t apply any jQuery methods using the browser console. But You can still play with jQuery functions by dynamically including the library using the Console itself. The below JavaScript will help you to do so.



Now you can perform normal jQuery functionalities inside HTML DOM just like the below example.

That’s it. Cheers..!! :)

Difference between ‘$(this)’ and ‘this’ keyword selector when using in jQuery

Hey there,

‘this’ and ‘$(this)’ in jQuery refers to the same element. The only difference is the way they are used. ‘this’ is used in traditional sense, when ‘this’ is wrapped in ‘$()’ then it becomes a jQuery object and you are able to use the power of jQuery.

$(this) Example:

this Example:

In the above example, this is an object but since it is not wrapped in $(), we can’t use jQuery method and use the native JavaScript this keyword to get the value of span element.

How to test whether an element is hidden using jQuery?

Hey there,

The below code helps you to test if an element is visible or hidden using jQuery.

For all elements,

You can use the hidden selector:

And the visible selector:

Enjoy Coding..Cheers..:)