{"id":985,"date":"2012-03-03T03:19:24","date_gmt":"2012-03-03T03:19:24","guid":{"rendered":"http:\/\/www.vishmax.com\/en\/?p=985"},"modified":"2012-05-19T12:18:01","modified_gmt":"2012-05-19T12:18:01","slug":"jquery-showhide-div-working-example","status":"publish","type":"post","link":"https:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/","title":{"rendered":"jQuery Show\/Hide Div Working Example"},"content":{"rendered":"<p>Are you looking a jQuery script which allows you to show \/hide a div in html? Here is a simple light weight script which is compatible with major web browsers. For using this script first you need to include jQuery library in your page, you can either use a downloaded version of jQuery or Google jQuery library. This example is using Google jQuery library.<\/p>\n<p>Once jQuery included (before <\/head>) the next part is to make a link which display Show\/hide menu. By clicking on this link a div will display and once again clicked it will hide. Now we can go to scripting part, please look below.<\/p>\n<h2>The JavaScript<\/h2>\n<pre lang=\"javascript\">\r\n<script src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.3.2\/jquery.js\" type=\"text\/javascript\"><\/script>\r\n<script type=\"text\/javascript\">\r\n \r\n$(document).ready(function(){\r\n \r\n        $(\".mySlder\").hide();\r\n        $(\".showHide\").show();\r\n \r\n    $('.showHide').click(function(){\r\n    $(\".mySlder\").slideToggle();\r\n    });\r\n \r\n});\r\n \r\n<\/script>\r\n<\/pre>\n<h2>The CSS<\/h2>\n<pre lang=\"css\">\r\n.mySlder {\r\n\tfloat:left;\r\n\twidth:100%;\r\n\theight:100px;\r\n\tbackground-color: #FFCC00;\r\n}\r\n \r\n.showHide {\r\n    display:none;\r\n}\r\n<\/pre>\n<h2>The HTML<\/h2>\n<pre lang=\"html\">\r\n<a href=\"#\" class=\"showHide\">Show\/hide<\/a>\r\n<div class=\"mySlder\">\r\nYour content goes here <a href=\"#\" class=\"showHide\">Hide me<\/a>\r\n<\/div>\r\n<\/pre>\n<p><\/br><\/br><\/p>\n<h2>The COMBAINED PAGE <\/h2>\n<pre lang=\"html\">\r\n<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=iso-8859-1\" \/>\r\n<title>jQuery Show\/Hide Div Working Example<\/title>\r\n<script src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.3.2\/jquery.js\" type=\"text\/javascript\"><\/script>\r\n<script type=\"text\/javascript\">\r\n \r\n$(document).ready(function(){\r\n \r\n        $(\".mySlder\").hide();\r\n        $(\".showHide\").show();\r\n \r\n    $('.showHide').click(function(){\r\n    $(\".mySlder\").slideToggle();\r\n    });\r\n \r\n});\r\n \r\n<\/script>\r\n<style type=\"text\/css\">\r\n<!--\r\n.mySlder {\r\n\tfloat:left;\r\n\twidth:100%;\r\n\theight:100px;\r\n\tbackground-color: #FFCC00;\r\n}\r\n \r\n.showHide {\r\n    display:none;\r\n}\r\n-->\r\n<\/style>\r\n<\/head>\r\n\r\n<body>\r\n<a href=\"#\" class=\"showHide\">Show\/hide<\/a>\r\n<div class=\"mySlder\">\r\nYour content goes here <a href=\"#\" class=\"showHide\">Hide me<\/a>\r\n<\/div>\r\n<\/body>\r\n<\/html>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Are you looking a jQuery script which allows you to show \/hide a div in html? Here is a simple light weight script which is compatible with major web browsers. For using this script first you need to include jQuery library in your page, you can either use a downloaded version of jQuery or Google [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[44],"tags":[53],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>jQuery Show\/Hide Div Working Example - Vishmax.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"jQuery Show\/Hide Div Working Example - Vishmax.com\" \/>\n<meta property=\"og:description\" content=\"Are you looking a jQuery script which allows you to show \/hide a div in html? Here is a simple light weight script which is compatible with major web browsers. For using this script first you need to include jQuery library in your page, you can either use a downloaded version of jQuery or Google [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Vishmax.com\" \/>\n<meta property=\"article:published_time\" content=\"2012-03-03T03:19:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-05-19T12:18:01+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"http:\/\/www.vishmax.com\/en\/#\/schema\/person\/785fa94b56eb17ae7706d30777d6ab93\"},\"headline\":\"jQuery Show\/Hide Div Working Example\",\"datePublished\":\"2012-03-03T03:19:24+00:00\",\"dateModified\":\"2012-05-19T12:18:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/\"},\"wordCount\":122,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/www.vishmax.com\/en\/#organization\"},\"keywords\":[\"jQuery\"],\"articleSection\":[\"Labs\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/\",\"url\":\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/\",\"name\":\"jQuery Show\/Hide Div Working Example - Vishmax.com\",\"isPartOf\":{\"@id\":\"http:\/\/www.vishmax.com\/en\/#website\"},\"datePublished\":\"2012-03-03T03:19:24+00:00\",\"dateModified\":\"2012-05-19T12:18:01+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.vishmax.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"jQuery Show\/Hide Div Working Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.vishmax.com\/en\/#website\",\"url\":\"http:\/\/www.vishmax.com\/en\/\",\"name\":\"Vishmax.com\",\"description\":\"Software Company in Calicut for Web Design and eCommerce\",\"publisher\":{\"@id\":\"http:\/\/www.vishmax.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.vishmax.com\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/www.vishmax.com\/en\/#organization\",\"name\":\"Vishmax.com\",\"url\":\"http:\/\/www.vishmax.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.vishmax.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vishmax.com\/en\/wp-content\/uploads\/2023\/03\/logo-vishmax.png\",\"contentUrl\":\"https:\/\/www.vishmax.com\/en\/wp-content\/uploads\/2023\/03\/logo-vishmax.png\",\"width\":150,\"height\":50,\"caption\":\"Vishmax.com\"},\"image\":{\"@id\":\"http:\/\/www.vishmax.com\/en\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.vishmax.com\/en\/#\/schema\/person\/785fa94b56eb17ae7706d30777d6ab93\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.vishmax.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e218268870406c917d20b442936d9e68?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e218268870406c917d20b442936d9e68?s=96&d=monsterid&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/www.vishmax.com\/en\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"jQuery Show\/Hide Div Working Example - Vishmax.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/","og_locale":"en_US","og_type":"article","og_title":"jQuery Show\/Hide Div Working Example - Vishmax.com","og_description":"Are you looking a jQuery script which allows you to show \/hide a div in html? Here is a simple light weight script which is compatible with major web browsers. For using this script first you need to include jQuery library in your page, you can either use a downloaded version of jQuery or Google [&hellip;]","og_url":"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/","og_site_name":"Vishmax.com","article_published_time":"2012-03-03T03:19:24+00:00","article_modified_time":"2012-05-19T12:18:01+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/#article","isPartOf":{"@id":"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/"},"author":{"name":"admin","@id":"http:\/\/www.vishmax.com\/en\/#\/schema\/person\/785fa94b56eb17ae7706d30777d6ab93"},"headline":"jQuery Show\/Hide Div Working Example","datePublished":"2012-03-03T03:19:24+00:00","dateModified":"2012-05-19T12:18:01+00:00","mainEntityOfPage":{"@id":"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/"},"wordCount":122,"commentCount":0,"publisher":{"@id":"http:\/\/www.vishmax.com\/en\/#organization"},"keywords":["jQuery"],"articleSection":["Labs"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/","url":"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/","name":"jQuery Show\/Hide Div Working Example - Vishmax.com","isPartOf":{"@id":"http:\/\/www.vishmax.com\/en\/#website"},"datePublished":"2012-03-03T03:19:24+00:00","dateModified":"2012-05-19T12:18:01+00:00","breadcrumb":{"@id":"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.vishmax.com\/en\/labs\/jquery-showhide-div-working-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.vishmax.com\/en\/"},{"@type":"ListItem","position":2,"name":"jQuery Show\/Hide Div Working Example"}]},{"@type":"WebSite","@id":"http:\/\/www.vishmax.com\/en\/#website","url":"http:\/\/www.vishmax.com\/en\/","name":"Vishmax.com","description":"Software Company in Calicut for Web Design and eCommerce","publisher":{"@id":"http:\/\/www.vishmax.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.vishmax.com\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/www.vishmax.com\/en\/#organization","name":"Vishmax.com","url":"http:\/\/www.vishmax.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.vishmax.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.vishmax.com\/en\/wp-content\/uploads\/2023\/03\/logo-vishmax.png","contentUrl":"https:\/\/www.vishmax.com\/en\/wp-content\/uploads\/2023\/03\/logo-vishmax.png","width":150,"height":50,"caption":"Vishmax.com"},"image":{"@id":"http:\/\/www.vishmax.com\/en\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"http:\/\/www.vishmax.com\/en\/#\/schema\/person\/785fa94b56eb17ae7706d30777d6ab93","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.vishmax.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e218268870406c917d20b442936d9e68?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e218268870406c917d20b442936d9e68?s=96&d=monsterid&r=g","caption":"admin"},"url":"https:\/\/www.vishmax.com\/en\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/posts\/985"}],"collection":[{"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/comments?post=985"}],"version-history":[{"count":0,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/posts\/985\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/media?parent=985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/categories?post=985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vishmax.com\/en\/wp-json\/wp\/v2\/tags?post=985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}