{"id":10278,"date":"2024-01-18T18:18:00","date_gmt":"2024-01-18T18:18:00","guid":{"rendered":"https:\/\/codehim.com\/?p=10278"},"modified":"2024-01-22T16:19:07","modified_gmt":"2024-01-22T11:19:07","slug":"thermometer-slider-widget-using-javascript","status":"publish","type":"post","link":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/","title":{"rendered":"Thermometer Slider Widget Using JavaScript"},"content":{"rendered":"<p>This code creates a thermometer slider widget using JavaScript. It lets you adjust temperature ranges visually. The slider modifies temperature values between -20\u00b0C to 50\u00b0C or Fahrenheit. You can change the temperature units between Celsius and Fahrenheit. Adjust the slider or click on the temperature values to modify them easily.<\/p>\n<p>This code for a thermometer slider widget is handy for websites needing temperature adjustment tools. It&#8217;s useful for weather apps, climate-related sites, or any platform requiring temperature settings. One major benefit is its intuitive visual interface for easy temperature control.<\/p>\n<h2>How to Create a Thermometer Slider Widget Using JavaScript<\/h2>\n<p>1. Start by creating the HTML structure. Copy the following code within the <code>&lt;div id=\"wrapper\"&gt;<\/code> tags. This includes the thermometer container, temperature slider, <a href=\"https:\/\/codehim.com\/material-design\/material-design-input-field-using-css\/\" target=\"_blank\" rel=\"noopener\">input fields<\/a>, and information paragraph.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;div id=\"wrapper\"&gt;\t\r\n\t&lt;div id=\"termometer\"&gt;\r\n\t\t&lt;div id=\"temperature\" style=\"height:0\" data-value=\"0\u00b0C\"&gt;&lt;\/div&gt;\r\n\t\t&lt;div id=\"graduations\"&gt;&lt;\/div&gt;\r\n\t&lt;\/div&gt;\r\n\t\r\n\t&lt;div id=\"playground\"&gt;\t\t\r\n\t\t&lt;div id=\"range\"&gt;\r\n\t\t\t&lt;input id=\"minTemp\" type=\"text\" value=\"-20\"&gt;\r\n\t\t\t&lt;input type=\"range\" min=\"-20\" max=\"50\" value=\"42\"&gt;\r\n\t\t\t&lt;input id=\"maxTemp\" type=\"text\" value=\"50\"&gt;\r\n\t\t&lt;\/div&gt;\r\n\t\t&lt;p id=\"unit\"&gt;Celcius C\u00b0&lt;\/p&gt;\r\n\t&lt;\/div&gt;\r\n\t\r\n\t&lt;p id=\"info\"&gt;Click on the values to change them!&lt;\/p&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>2. Copy the following CSS code to style the thermometer and its components. This code ensures a visually appealing and responsive design. You can customize colors and dimensions to match your website&#8217;s theme.<\/p>\n<pre class=\"prettyprint linenums lang-css\">@import url(\"https:\/\/fonts.googleapis.com\/css?family=Jaldi&amp;display=swap\");\r\nbody {\r\n  display: flex;\r\n  height: 100vh;\r\n  margin: 0;\r\n  font-family: \"Jaldi\", sans-serif;\r\n  font-size: 14px;\r\n}\r\n\r\n#wrapper {\r\n  margin: auto;\r\n  display: flex;\r\n  flex-direction: column;\r\n  align-items: center;\r\n}\r\n\r\np {\r\n  -webkit-user-select: none;\r\n  -moz-user-select: none;\r\n  -ms-user-select: none;\r\n  user-select: none;\r\n}\r\n\r\n#info {\r\n  opacity: 0.2;\r\n  margin: 0;\r\n  text-align: center;\r\n}\r\n\r\n#termometer {\r\n  width: 25px;\r\n  background: #38383f;\r\n  height: 240px;\r\n  position: relative;\r\n  border: 9px solid #2a2a2e;\r\n  border-radius: 20px;\r\n  z-index: 1;\r\n  margin-bottom: 50px;\r\n}\r\n#termometer:before, #termometer:after {\r\n  position: absolute;\r\n  content: \"\";\r\n  border-radius: 50%;\r\n}\r\n#termometer:before {\r\n  width: 100%;\r\n  height: 34px;\r\n  bottom: 9px;\r\n  background: #38383f;\r\n  z-index: -1;\r\n}\r\n#termometer:after {\r\n  transform: translateX(-50%);\r\n  width: 50px;\r\n  height: 50px;\r\n  background-color: #3dcadf;\r\n  bottom: -41px;\r\n  border: 9px solid #2a2a2e;\r\n  z-index: -3;\r\n  left: 50%;\r\n}\r\n#termometer #graduations {\r\n  height: 59%;\r\n  top: 20%;\r\n  width: 50%;\r\n}\r\n#termometer #graduations, #termometer #graduations:before {\r\n  position: absolute;\r\n  border-top: 2px solid rgba(0, 0, 0, 0.5);\r\n  border-bottom: 2px solid rgba(0, 0, 0, 0.5);\r\n}\r\n#termometer #graduations:before {\r\n  content: \"\";\r\n  height: 34%;\r\n  width: 100%;\r\n  top: 32%;\r\n}\r\n#termometer #temperature {\r\n  bottom: 0;\r\n  background: linear-gradient(#f17a65, #3dcadf) no-repeat bottom;\r\n  width: 100%;\r\n  border-radius: 20px;\r\n  background-size: 100% 240px;\r\n  transition: all 0.2s ease-in-out;\r\n}\r\n#termometer #temperature, #termometer #temperature:before, #termometer #temperature:after {\r\n  position: absolute;\r\n}\r\n#termometer #temperature:before {\r\n  content: attr(data-value);\r\n  background: rgba(0, 0, 0, 0.7);\r\n  color: white;\r\n  z-index: 2;\r\n  padding: 5px 10px;\r\n  border-radius: 5px;\r\n  font-size: 1em;\r\n  line-height: 1;\r\n  transform: translateY(50%);\r\n  left: calc(100% + 1em \/ 1.5);\r\n  top: calc(-1em + 5px - 5px * 2);\r\n}\r\n#termometer #temperature:after {\r\n  content: \"\";\r\n  border-top: 0.4545454545em solid transparent;\r\n  border-bottom: 0.4545454545em solid transparent;\r\n  border-right: 0.6666666667em solid rgba(0, 0, 0, 0.7);\r\n  left: 100%;\r\n  top: calc(-1em \/ 2.2 + 5px);\r\n}\r\n\r\n#playground {\r\n  font-size: 1.1em;\r\n}\r\n#playground #range {\r\n  display: flex;\r\n}\r\n#playground #range input[type=text] {\r\n  width: 2em;\r\n  background: transparent;\r\n  border: none;\r\n  color: inherit;\r\n  font: inherit;\r\n  margin: 0 5px;\r\n  padding: 0px 5px;\r\n  border-bottom: 2px solid transparent;\r\n  transition: all 0.2s ease-in-out;\r\n}\r\n#playground #range input[type=text]:focus {\r\n  border-color: #3dcadf;\r\n  outline: none;\r\n}\r\n#playground #range input[type=text]:first-child {\r\n  text-align: right;\r\n}\r\n#playground #unit {\r\n  width: 100%;\r\n  margin: 0;\r\n  text-align: center;\r\n}\r\n#playground #unit:hover {\r\n  cursor: pointer;\r\n}\r\n\r\ninput[type=range] {\r\n  -webkit-appearance: none;\r\n  background: transparent;\r\n  margin: 5.5px 0;\r\n  width: 100%;\r\n}\r\ninput[type=range]::-moz-focus-outer {\r\n  border: 0;\r\n}\r\ninput[type=range]:hover {\r\n  cursor: pointer;\r\n}\r\ninput[type=range]:focus {\r\n  outline: 0;\r\n}\r\ninput[type=range]:focus::-webkit-slider-runnable-track {\r\n  background: #313137;\r\n  border-color: #313137;\r\n}\r\ninput[type=range]:focus::-ms-fill-lower {\r\n  background: #2a2a2e;\r\n}\r\ninput[type=range]:focus::-ms-fill-upper {\r\n  background: #313137;\r\n  border-color: #313137;\r\n}\r\ninput[type=range]::-webkit-slider-runnable-track {\r\n  cursor: default;\r\n  height: 10px;\r\n  transition: all 0.2s ease;\r\n  width: 100%;\r\n  cursor: pointer;\r\n  transition: all 0.2s ease-in-out;\r\n  box-shadow: 1px 1px 1px transparent, 0 0 1px rgba(13, 13, 13, 0);\r\n  background: #2a2a2e;\r\n  border: 2px solid #2a2a2e;\r\n  border-radius: 5px;\r\n}\r\ninput[type=range]::-webkit-slider-thumb {\r\n  box-shadow: 4px 4px 4px transparent, 0 0 4px rgba(13, 13, 13, 0);\r\n  background: #3dcadf;\r\n  border: 0px solid #3d3d44;\r\n  border-radius: 12px;\r\n  cursor: pointer;\r\n  height: 11px;\r\n  width: 18px;\r\n  -webkit-appearance: none;\r\n  margin-top: -2.5px;\r\n}\r\ninput[type=range]::-moz-range-track {\r\n  box-shadow: 1px 1px 1px transparent, 0 0 1px rgba(13, 13, 13, 0);\r\n  cursor: default;\r\n  height: 10px;\r\n  transition: all 0.2s ease;\r\n  width: 100%;\r\n  cursor: pointer;\r\n  transition: all 0.2s ease-in-out;\r\n  background: #2a2a2e;\r\n  border: 2px solid #2a2a2e;\r\n  border-radius: 5px;\r\n  height: 5px;\r\n}\r\ninput[type=range]::-moz-range-thumb {\r\n  box-shadow: 4px 4px 4px transparent, 0 0 4px rgba(13, 13, 13, 0);\r\n  background: #3dcadf;\r\n  border: 0px solid #3d3d44;\r\n  border-radius: 12px;\r\n  cursor: pointer;\r\n  height: 7px;\r\n  width: 14px;\r\n}\r\ninput[type=range]::-ms-track {\r\n  cursor: default;\r\n  height: 10px;\r\n  transition: all 0.2s ease;\r\n  width: 100%;\r\n  cursor: pointer;\r\n  transition: all 0.2s ease-in-out;\r\n  background: transparent;\r\n  border-color: transparent;\r\n  border-width: 5.5px 0;\r\n  color: transparent;\r\n}\r\ninput[type=range]::-ms-fill-lower {\r\n  box-shadow: 1px 1px 1px transparent, 0 0 1px rgba(13, 13, 13, 0);\r\n  background: #222226;\r\n  border: 2px solid #2a2a2e;\r\n  border-radius: 10px;\r\n}\r\ninput[type=range]::-ms-fill-upper {\r\n  box-shadow: 1px 1px 1px transparent, 0 0 1px rgba(13, 13, 13, 0);\r\n  background: #2a2a2e;\r\n  border: 2px solid #2a2a2e;\r\n  border-radius: 10px;\r\n}\r\ninput[type=range]::-ms-thumb {\r\n  box-shadow: 4px 4px 4px transparent, 0 0 4px rgba(13, 13, 13, 0);\r\n  background: #3dcadf;\r\n  border: 0px solid #3d3d44;\r\n  border-radius: 12px;\r\n  cursor: pointer;\r\n  height: 7px;\r\n  width: 14px;\r\n  margin-top: 2.5px;\r\n}\r\ninput[type=range]:disabled::-webkit-slider-thumb {\r\n  cursor: not-allowed;\r\n}\r\ninput[type=range]:disabled::-moz-range-thumb {\r\n  cursor: not-allowed;\r\n}\r\ninput[type=range]:disabled::-ms-thumb {\r\n  cursor: not-allowed;\r\n}\r\ninput[type=range]:disabled::-webkit-slider-runnable-track {\r\n  cursor: not-allowed;\r\n}\r\ninput[type=range]:disabled::-ms-fill-lower {\r\n  cursor: not-allowed;\r\n}\r\ninput[type=range]:disabled::-ms-fill-upper {\r\n  cursor: not-allowed;\r\n}<\/pre>\n<p>3. Finally, copy the JavaScript code. This code enables dynamic temperature adjustments and unit switching. It calculates the temperature&#8217;s visual representation based on the slider&#8217;s position.<\/p>\n<pre class=\"prettyprint linenums lang-js\">const units = {\r\n  Celcius: \"\u00b0C\",\r\n  Fahrenheit: \"\u00b0F\" };\r\n\r\n\r\nconst config = {\r\n  minTemp: -20,\r\n  maxTemp: 50,\r\n  unit: \"Celcius\" };\r\n\r\n\r\n\/\/ Change min and max temperature values\r\n\r\nconst tempValueInputs = document.querySelectorAll(\"input[type='text']\");\r\n\r\ntempValueInputs.forEach(input =&gt; {\r\n  input.addEventListener(\"change\", event =&gt; {\r\n    const newValue = event.target.value;\r\n\r\n    if (isNaN(newValue)) {\r\n      return input.value = config[input.id];\r\n    } else {\r\n      config[input.id] = input.value;\r\n      range[input.id.slice(0, 3)] = config[input.id]; \/\/ Update range\r\n      return setTemperature(); \/\/ Update temperature\r\n    }\r\n  });\r\n});\r\n\r\n\/\/ Switch unit of temperature\r\n\r\nconst unitP = document.getElementById(\"unit\");\r\n\r\nunitP.addEventListener(\"click\", () =&gt; {\r\n  config.unit = config.unit === \"Celcius\" ? \"Fahrenheit\" : \"Celcius\";\r\n  unitP.innerHTML = config.unit + ' ' + units[config.unit];\r\n  return setTemperature();\r\n});\r\n\r\n\/\/ Change temperature\r\n\r\nconst range = document.querySelector(\"input[type='range']\");\r\nconst temperature = document.getElementById(\"temperature\");\r\n\r\nfunction setTemperature() {\r\n  temperature.style.height = (range.value - config.minTemp) \/ (config.maxTemp - config.minTemp) * 100 + \"%\";\r\n  temperature.dataset.value = range.value + units[config.unit];\r\n}\r\n\r\nrange.addEventListener(\"input\", setTemperature);\r\nsetTimeout(setTemperature, 1000);<\/pre>\n<p>That&#8217;s all! hopefully, you have successfully created the Thermometer Slider Widget Using JavaScript. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This code creates a thermometer slider widget using JavaScript. It lets you adjust temperature ranges visually. The slider modifies temperature&#8230;<\/p>\n","protected":false},"author":1,"featured_media":10288,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[116],"tags":[],"class_list":["post-10278","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vanilla-javascript"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Thermometer Slider Widget Using JavaScript &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a Thermometer Slider Widget Using JavaScript. You can view demo and download the source code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Thermometer Slider Widget Using JavaScript &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a Thermometer Slider Widget Using JavaScript. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeHim\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codehimofficial\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-18T18:18:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-22T11:19:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"980\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Asif Mughal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:site\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Asif Mughal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"Thermometer Slider Widget Using JavaScript\",\"datePublished\":\"2024-01-18T18:18:00+00:00\",\"dateModified\":\"2024-01-22T11:19:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/\"},\"wordCount\":217,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png\",\"articleSection\":[\"Vanilla JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/\",\"url\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/\",\"name\":\"Thermometer Slider Widget Using JavaScript &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png\",\"datePublished\":\"2024-01-18T18:18:00+00:00\",\"dateModified\":\"2024-01-22T11:19:07+00:00\",\"description\":\"Here is a free code snippet to create a Thermometer Slider Widget Using JavaScript. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png\",\"width\":1280,\"height\":980,\"caption\":\"Thermometer Slider Widget Using JavaScript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vanilla JavaScript\",\"item\":\"https:\/\/codehim.com\/category\/vanilla-javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Thermometer Slider Widget Using JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codehim.com\/#website\",\"url\":\"https:\/\/codehim.com\/\",\"name\":\"CodeHim\",\"description\":\"Web Design Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"alternateName\":\"Web Design Codes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codehim.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codehim.com\/#organization\",\"name\":\"CodeHim - Web Design Code & Scripts\",\"url\":\"https:\/\/codehim.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"contentUrl\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"width\":280,\"height\":280,\"caption\":\"CodeHim - Web Design Code & Scripts\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/codehimofficial\",\"https:\/\/x.com\/CodeHimOfficial\",\"https:\/\/www.instagram.com\/codehim\/\",\"https:\/\/www.linkedin.com\/company\/codehim\",\"https:\/\/co.pinterest.com\/codehim\/\",\"https:\/\/www.youtube.com\/@codehim\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\",\"name\":\"Asif Mughal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"caption\":\"Asif Mughal\"},\"description\":\"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.\",\"sameAs\":[\"https:\/\/codehim.com\"],\"url\":\"https:\/\/codehim.com\/author\/asif-mughal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Thermometer Slider Widget Using JavaScript &#8212; CodeHim","description":"Here is a free code snippet to create a Thermometer Slider Widget Using JavaScript. You can view demo and download the source code.","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":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Thermometer Slider Widget Using JavaScript &#8212; CodeHim","og_description":"Here is a free code snippet to create a Thermometer Slider Widget Using JavaScript. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-01-18T18:18:00+00:00","article_modified_time":"2024-01-22T11:19:07+00:00","og_image":[{"width":1280,"height":980,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png","type":"image\/png"}],"author":"Asif Mughal","twitter_card":"summary_large_image","twitter_creator":"@CodeHimOfficial","twitter_site":"@CodeHimOfficial","twitter_misc":{"Written by":"Asif Mughal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"Thermometer Slider Widget Using JavaScript","datePublished":"2024-01-18T18:18:00+00:00","dateModified":"2024-01-22T11:19:07+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/"},"wordCount":217,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png","articleSection":["Vanilla JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/","url":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/","name":"Thermometer Slider Widget Using JavaScript &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png","datePublished":"2024-01-18T18:18:00+00:00","dateModified":"2024-01-22T11:19:07+00:00","description":"Here is a free code snippet to create a Thermometer Slider Widget Using JavaScript. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/Thermometer-Slider-Widget-Using-JavaScript.png","width":1280,"height":980,"caption":"Thermometer Slider Widget Using JavaScript"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/vanilla-javascript\/thermometer-slider-widget-using-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"Vanilla JavaScript","item":"https:\/\/codehim.com\/category\/vanilla-javascript\/"},{"@type":"ListItem","position":3,"name":"Thermometer Slider Widget Using JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/codehim.com\/#website","url":"https:\/\/codehim.com\/","name":"CodeHim","description":"Web Design Code Snippets","publisher":{"@id":"https:\/\/codehim.com\/#organization"},"alternateName":"Web Design Codes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codehim.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codehim.com\/#organization","name":"CodeHim - Web Design Code & Scripts","url":"https:\/\/codehim.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/","url":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","contentUrl":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","width":280,"height":280,"caption":"CodeHim - Web Design Code & Scripts"},"image":{"@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codehimofficial","https:\/\/x.com\/CodeHimOfficial","https:\/\/www.instagram.com\/codehim\/","https:\/\/www.linkedin.com\/company\/codehim","https:\/\/co.pinterest.com\/codehim\/","https:\/\/www.youtube.com\/@codehim"]},{"@type":"Person","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed","name":"Asif Mughal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","caption":"Asif Mughal"},"description":"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.","sameAs":["https:\/\/codehim.com"],"url":"https:\/\/codehim.com\/author\/asif-mughal\/"}]}},"views":2458,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/comments?post=10278"}],"version-history":[{"count":0,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10278\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/10288"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=10278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=10278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=10278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}