Skip to main content

Hide and Show Elements with jQuery

By Sam Deering

With jQuery you can hide and show page elements very easily. The page elements can be anything such as a div, an image, a paragraph or anything that is on your webpage really.

This is how you do it:

$(this).hide() //hides current element

$("p").hide() //hides all paragraphs

$("p.test").hide() //hides all paragraphs

$("#test").hide() //hides the element with id="test"

Live demos:


Sam Deering has 15+ years of programming and website development experience. He was a website consultant at Console, ABC News, Flight Centre, Sapient Nitro, and the QLD Government and runs a tech blog with over 1 million views per month. Currently, Sam is the Founder of Crypto News, Australia.

Integromat Tower Ad