jQuery toggleClass example
Toggle class name on click in jQuery
by adamovic
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="canonical" href="https://www.numbeo.com/cost-of-living/in/Johannesburg" />
<meta property="og:title" content="Cost of Living in Johannesburg" />
<meta property="og:description" content="Average prices of more than 40 products and services in Johannesburg, South AfricaNov 2020. Prices of restaurants, food, transportation, utilities and housing are included. " />
<meta property="og:type" content="website"/>
<meta property="og:url" content="https://www.numbeo.com/cost-of-living/in/Johannesburg"/>
<link rel="alternate" hreflang="en" href="https://www.numbeo.com/cost-of-living/in/Johannesburg" />
<link rel="alternate" hreflang="de" href="https://de.numbeo.com/lebenshaltungskosten/stadt/Johannesburg" />
<link rel="alternate" hreflang="pt" href="https://pt.numbeo.com/custo-de-vida/cidade/Joanesburgo" />
<link rel="alternate" hreflang="it" href="https://it.numbeo.com/costo-della-vita/citt%C3%A0/Johannesburg" />
<link rel="alternate" hreflang="fr" href="https://fr.numbeo.com/co%C3%BBt-de-la-vie/ville/Johannesbourg" />
<link rel="alternate" hreflang="es" href="https://es.numbeo.com/coste-de-vida/ciudad/Johannesburgo" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script defer src="https://www.numbeo.com/common/numbeo_standard.js"></script>
<link type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.min.css" rel="Stylesheet" />
<link rel="shortcut icon" type="image/x-icon" href="https://www.numbeo.com/favicon.ico" />
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script src='https://www.google.com/jsapi'></script>
<script>
if (typeof whenDocReady === "function") {
// already declared,...