jQuery addClass example

Change class name on click in jQuery

by Shuaib Khan

HTML

<div id="json">
</div>

CSS

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#banner-message {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  font-size: 25px;
  text-align: center;
  transition: all 0.2s;
  margin: 0 auto;
  width: 300px;
}

button {
  background: #0084ff;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 15px;
  color: #fff;
}

#banner-message.alt {
  background: #0084ff;
  color: #fff;
  margin-top: 40px;
  width: 200px;
}

#banner-message.alt button {
  background: #fff;
  color: #000;
}

JavaScript

var obj = {
    "InstaCash - Sell Old Mobile & Smartphones for Instant Cash":"InstaCash - Sell Old Mobile & Smartphones for Instant Cash",
    "Grab the best deal on":"Grab the best deal on",
    "your old smartphone!":"your old smartphone!",
    "Instant":"Instant",
    "Let's get started. What are you selling today?":"Let's get started. What are you selling 2day?",
    "Enter Device Name":"Enter Device Name",
    "Loading.. please wait..":"Loading.. please wait..",
    "Recent Searches":"Recent Searches",
    "Devices":"Devices",
    "Recent search":"Recent search",
    "Get upto":"Get upto",
    "Get Exact Quote":"Get Exact Quote",
    "Or choose a brand":"Or choose a brand",
    "other brands":"other brands",
    "https:\/\/instacash.blob.core.windows.net\/static\/live\/in-new\/images\/appStoreButton.svg":"https:\/\/instacash.blob.core.windows.net\/static\/live\/in-new\/images\/appStoreButton.svg",
    "https:\/\/instacash.blob.core.windows.net\/static\/live\/in-new\/images\/playstoreButton.svg":"https:\/\/instacash.blob.core.windows.net\/static\/live\/in-new\/images\/playstoreButton.svg",
    "Or send link to Mobile Number":"Or send link to Mobile Number",
    "Enter your Mobile Number":"Enter your Mobile Number",
    "Please enter valid Mobile Number":"Please enter valid Mobile Number",
    "Send":"Send",
    "Just 3 Steps":"Just 3 Steps",
    "Get Price":"Get Price",
    "Enter your phone details.":"Enter your phone details.",
    "Get instant buyback offer.":"Get instant buyback offer.",
    "Download App and complete diagnostics.":"Download App and complete diagnostics.",
    "Seal the deal!":"Seal the deal!",
    "Confirm Pickup":"Confirm Pickup....",
    "Where would you like pickup?":"Where would you like pickup?",
    "When?":"When?",
    "Just tell us.":"Just tell us.",
    "We'll get in touch instantly.":"We'll get in touch instantly.",
    "Instant Payment":"Instant Payment",
    "Receive payment before your":"Receive payment before your",
   ...