{"id":6039,"date":"2024-01-11T16:40:00","date_gmt":"2024-01-11T16:40:00","guid":{"rendered":"https:\/\/codehim.com\/?p=6039"},"modified":"2024-01-22T14:43:42","modified_gmt":"2024-01-22T09:43:42","slug":"javascript-alarm-clock-with-sound","status":"publish","type":"post","link":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/","title":{"rendered":"JavaScript Alarm Clock with Sound"},"content":{"rendered":"<p>This JavaScript code snippet helps you to create an alarm clock with sound. It comes with a <a href=\"https:\/\/codehim.com\/date-time\/css-and-javascript-digital-clock-widget\/\" target=\"_blank\" rel=\"noopener\">digital clock<\/a> that shows the current time and alarm settings interface. Users can easily set an alarm for a certain time, when the alarm starts, the user can turn it off or snooze for the next five minutes.<\/p>\n<p>You can integrate this alarm code snippet in your project as a reminder or allow users to set an alarm for a certain time. Similarly, it can also be used in <a href=\"https:\/\/codehim.com\/text-input\/simple-quiz-application-with-timer-using-javascript\/\" target=\"_blank\" rel=\"noopener\">quiz app with timer<\/a> or limited-time offers to alert the users with sound.<\/p>\n<h2>How to Create JavaScript Alarm Clock with Sound<\/h2>\n<p>1. First of all, load the Normalize CSS and <a href=\"https:\/\/fonts.google.com\/specimen\/Orbitron\" target=\"_blank\" rel=\"noopener\">Orbitron (digital clock fonts)<\/a> CSS into the head tag of your webpage.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;!-- Normalize CSS --&gt;\r\n&lt;link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/normalize\/5.0.0\/normalize.min.css\"&gt;\r\n&lt;!-- Orbitron Fonts CSS --&gt;\r\n&lt;link href=\"https:\/\/fonts.googleapis.com\/css?family=Orbitron\" rel=\"stylesheet\"&gt;\r\n<\/pre>\n<p>2. After that, create a div element with a class name &#8220;clock-wrapper&#8221; and place the h2 heading element with a class name &#8220;clock&#8221; inside it. Similarly, create the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/select\" target=\"_blank\" rel=\"noopener\">select elements<\/a> for hours, minutes, seconds, and AM\/PM for alarm settings. Likewise, create two buttons for a snooze and set an alarm. So, the complete HTML structure for the clock and alarm settings is as follows:<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;div class=\"table clock-wrapper\"&gt;\r\n  &lt;div class=\"cell\"&gt;\r\n    &lt;h2 id=\"clock\" class=\"clock\"&gt;&lt;\/h2&gt;\r\n    \r\n    &lt;select id=\"hours\"&gt;&lt;\/select&gt;\r\n    &lt;select id=\"minutes\"&gt;&lt;\/select&gt;\r\n    &lt;select id=\"seconds\"&gt;&lt;\/select&gt;\r\n    &lt;select id=\"ampm\"&gt;\r\n      &lt;option value=\"AM\"&gt;AM&lt;\/option&gt;\r\n      &lt;option value=\"PM\"&gt;PM&lt;\/option&gt;\r\n    &lt;\/select&gt;\r\n    \r\n    &lt;p&gt;\r\n      &lt;button id=\"snooze\" class=\"hide\"&gt;Snooze&lt;\/button&gt;\r\n      &lt;button id=\"startstop\"&gt;Set Alarm&lt;\/button&gt;\r\n    &lt;\/p&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p>3. Now, style the clock using the following CSS styles. You can define your own CSS or modify it in order to customize the alarm clock according to your needs.<\/p>\n<pre class=\"prettyprint linenums lang-css\">.clock-wrapper{\r\n    line-height: 2;\r\n}\r\n\r\n\/* header *\/\r\n.clock-wrapper h2 {\r\n  font-family: 'Orbitron', sans-serif;\r\n  font-size: 4em;\r\n  color: #fff;\r\n}\r\n\r\n\/* buttons *\/\r\n.clock-wrapper button {\r\n  cursor: pointer;\r\n  margin: 0 5px;\r\n  padding: 10px 30px;\r\n  background: transparent;\r\n  border: 1px solid #ccc;\r\n  border-radius: 8px;\r\n  outline: 0;\r\n  color: #fff;\r\n  transition: all ease 300ms;\r\n  margin: 10px 0;\r\n}\r\n.clock-wrapper button:hover {\r\n  color: #333;\r\n  background: #fff;\r\n  \r\n}\r\n\r\n\/* center content vertically and horizontally *\/\r\n.table {\r\n  display: table;\r\n  width: 100%;\r\n  height: 100%;\r\n}\r\n.cell {\r\n  display: table-cell;\r\n  vertical-align: middle;\r\n  cursor: default;\r\n}\r\n\r\n\/* variable misc classes *\/\r\n.hide {\r\n  display: none;\r\n}\r\n<\/pre>\n<p>4. Finally, add the following JavaScript function between the &lt;script&gt; tag before closing the body tag and done.<\/p>\n<pre class=\"prettyprint linenums lang-js\">\/\/ set our variables\r\nvar time, alarm, currentH, currentM,\r\n    activeAlarm = false,\r\n    sound = new Audio(\"https:\/\/freesound.org\/data\/previews\/316\/316847_4939433-lq.mp3\");\r\n\r\n\/*\r\n  audio sound source: https:\/\/freesound.org\/people\/SieuAmThanh\/sounds\/397787\/\r\n*\/\r\n\r\n\/\/ loop alarm\r\nsound.loop = true;\r\n\r\n\/\/ define a function to display the current time\r\nfunction displayTime() {\r\n  var now = new Date();\r\n  time = now.toLocaleTimeString();\r\n  clock.textContent = time;\r\n  \/\/ time = \"1:00:00 AM\";\r\n  \/\/ watch for alarm\r\n  if (time === alarm) {\r\n    sound.play();\r\n    \r\n    \/\/ show snooze button\r\n    snooze.className = \"\";\r\n  }\r\n  setTimeout(displayTime, 1000);\r\n}\r\ndisplayTime();\r\n\r\n\/\/ add option values relative towards time\r\nfunction addMinSecVals(id) {\r\n  var select = id;\r\n  var min = 59;\r\n  \r\n  for (i = 0; i &lt;= min; i++) {\r\n    \/\/ defined as new Option(text, value)\r\n    select.options[select.options.length] = new Option(i &lt; 10 ? \"0\" + i : i, i &lt; 10 ? \"0\" + i : i);\r\n  }\r\n}\r\nfunction addHours(id) {\r\n  var select = id;\r\n  var hour = 12;\r\n  \r\n  for (i = 1; i &lt;= hour; i++) {\r\n    \/\/ defined as new Option(text, value)\r\n    select.options[select.options.length] = new Option(i &lt; 10 ? \"0\" + i : i, i);\r\n  }\r\n}\r\naddMinSecVals(minutes);\r\naddMinSecVals(seconds);\r\naddHours(hours);\r\n\r\n\/\/ set and clear alarm\r\nstartstop.onclick = function() {\r\n  \/\/ set the alarm\r\n  if (activeAlarm === false) {\r\n    hours.disabled = true;\r\n    minutes.disabled = true;\r\n    seconds.disabled = true;\r\n    ampm.disabled = true;\r\n    \r\n    alarm = hours.value + \":\" + minutes.value + \":\" + seconds.value + \" \" + ampm.value;\r\n    this.textContent = \"Clear Alarm\";\r\n    activeAlarm = true;\r\n  } else {\r\n    \/\/ clear the alarm\r\n    hours.disabled = false;\r\n    minutes.disabled = false;\r\n    seconds.disabled = false;\r\n    ampm.disabled = false;\r\n    \r\n    sound.pause();\r\n    alarm = \"00:00:00 AM\";\r\n    this.textContent = \"Set Alarm\";\r\n    \r\n    \/\/ hide snooze button\r\n    snooze.className = \"hide\";\r\n    activeAlarm = false;\r\n  }\r\n};\r\n\r\n\/\/ snooze for 5 minutes\r\nsnooze.onclick = function() {\r\n  if (activeAlarm === true) {\r\n    \/\/ grab the current hour and minute\r\n    currentH = time.substr(0, time.length - 9);\r\n    currentM = time.substr(currentH.length + 1, time.length - 8);\r\n    \r\n    if (currentM &gt;= \"55\") {\r\n      minutes.value = \"00\";\r\n      hours.value = parseInt(currentH) + 1;\r\n    } else {\r\n      if (parseInt(currentM) + 5 &lt;= 9) {\r\n        minutes.value = \"0\" + parseInt(currentM + 5);\r\n      } else {\r\n        minutes.value = parseInt(currentM) + 5;\r\n      }\r\n    }\r\n    \r\n    \/\/ hide snooze button\r\n    snooze.className = \"hide\";\r\n    \r\n    \/\/ now reset alarm\r\n    startstop.click();\r\n    startstop.click();\r\n  } else {\r\n    return false;\r\n  }\r\n};\r\n<\/pre>\n<p>That&#8217;s all! Hopefully, you have successfully integrated this alarm clock into your project. If you have any questions or facing any issues, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This JavaScript code snippet helps you to create an alarm clock with sound. It comes with a digital clock that&#8230;<\/p>\n","protected":false},"author":1,"featured_media":6043,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[58,116],"tags":[88],"class_list":["post-6039","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-date-time","category-vanilla-javascript","tag-digital-clocks"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JavaScript Alarm Clock with Sound &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a lightweight JavaScript alarm clock with sound. This clock displays digital time and allows users to set alarm for specific time.\" \/>\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\/date-time\/javascript-alarm-clock-with-sound\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Alarm Clock with Sound &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a lightweight JavaScript alarm clock with sound. This clock displays digital time and allows users to set alarm for specific time.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/\" \/>\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-11T16:40:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-22T09:43:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"JavaScript Alarm Clock with Sound\",\"datePublished\":\"2024-01-11T16:40:00+00:00\",\"dateModified\":\"2024-01-22T09:43:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/\"},\"wordCount\":272,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.png\",\"keywords\":[\"Digital Clocks\"],\"articleSection\":[\"Date &amp; Time\",\"Vanilla JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/\",\"url\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/\",\"name\":\"JavaScript Alarm Clock with Sound &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.png\",\"datePublished\":\"2024-01-11T16:40:00+00:00\",\"dateModified\":\"2024-01-22T09:43:42+00:00\",\"description\":\"Here is a lightweight JavaScript alarm clock with sound. This clock displays digital time and allows users to set alarm for specific time.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.png\",\"width\":1280,\"height\":960,\"caption\":\"JavaScript Alarm Clock with Sound\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Date &amp; Time\",\"item\":\"https:\/\/codehim.com\/category\/date-time\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript Alarm Clock with Sound\"}]},{\"@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":"JavaScript Alarm Clock with Sound &#8212; CodeHim","description":"Here is a lightweight JavaScript alarm clock with sound. This clock displays digital time and allows users to set alarm for specific time.","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\/date-time\/javascript-alarm-clock-with-sound\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Alarm Clock with Sound &#8212; CodeHim","og_description":"Here is a lightweight JavaScript alarm clock with sound. This clock displays digital time and allows users to set alarm for specific time.","og_url":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-01-11T16:40:00+00:00","article_modified_time":"2024-01-22T09:43:42+00:00","og_image":[{"width":1280,"height":960,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"JavaScript Alarm Clock with Sound","datePublished":"2024-01-11T16:40:00+00:00","dateModified":"2024-01-22T09:43:42+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/"},"wordCount":272,"commentCount":1,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.png","keywords":["Digital Clocks"],"articleSection":["Date &amp; Time","Vanilla JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/","url":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/","name":"JavaScript Alarm Clock with Sound &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.png","datePublished":"2024-01-11T16:40:00+00:00","dateModified":"2024-01-22T09:43:42+00:00","description":"Here is a lightweight JavaScript alarm clock with sound. This clock displays digital time and allows users to set alarm for specific time.","breadcrumb":{"@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2022\/02\/javascript-alarm-clock-with-sound.png","width":1280,"height":960,"caption":"JavaScript Alarm Clock with Sound"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/date-time\/javascript-alarm-clock-with-sound\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"Date &amp; Time","item":"https:\/\/codehim.com\/category\/date-time\/"},{"@type":"ListItem","position":3,"name":"JavaScript Alarm Clock with Sound"}]},{"@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":14020,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/6039","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=6039"}],"version-history":[{"count":0,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/6039\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/6043"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=6039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=6039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=6039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}