{"id":5547,"date":"2023-05-07T11:01:12","date_gmt":"2023-05-07T15:01:12","guid":{"rendered":"https:\/\/www.cloudsurph.com\/?p=5547"},"modified":"2023-05-20T11:11:32","modified_gmt":"2023-05-20T15:11:32","slug":"how-to-pass-variables-from-an-html-page-to-another-with-javascript","status":"publish","type":"post","link":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/","title":{"rendered":"How to Pass Variables from an HTML Page to Another with JavaScript"},"content":{"rendered":"<p dir=\"auto\" data-pm-slice=\"1 1 []\">Passing variables from one HTML page to another is a common task in web development. With JavaScript, you can easily pass variables between pages and create a more dynamic user experience. This tutorial will show you how to pass a variable from an HTML page to another using JavaScript. We&#8217;ll discuss the different ways of doing it, as well as provide examples of code that you can use in your own projects.<\/p>\n<h5><em><strong>If you want then buy a good, reliable, secure web\u00a0<a href=\"https:\/\/www.cloudsurph.com\/windows-vps-hosting\/\">hosting<\/a>\u00a0service \u00a0from here:\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">click here<\/a><\/strong><\/em><\/h5>\n<h2>How to Pass Variables from an HTML Page to Another with JavaScript<\/h2>\n<p>In order to pass variables from one HTML page to another with JavaScript, it is necessary to first understand how to properly create and store the variables within the JavaScript code. For this example, we will be passing two variables, a string variable and a boolean variable, from one HTML page to another. We will be using the window.location object to accomplish this task.<\/p>\n<p>We have one way to pass a variable from an HTML page to another using JavaScript and it is to use the browser\u2019s <code>localStorage<\/code>\u00a0object.<\/p>\n<p><code>localStorage<\/code> provides us a way to store key-value pairs in the user\u2019s web browser, so that they push across different pages and sessions.<\/p>\n<p>So, check the below example of how you could use <code>localStorage<\/code>\u00a0to pass a variable between two HTML pages.<\/p>\n<h3>Previous JavaScript Articles<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.cloudsurph.com\/javascript-variables\/\" aria-current=\"page\">JavaScript Variables<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/javascript-operators\/\">JavaScript Operators<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/creating-an-object-in-javascript\/\">Creating an Object in JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/what-is-asynchronous-javascript\/\">Introduction to Asynchronous JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/what-is-control-flow-in-javascript\/\">Control Flow in JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/how-to-use-regex-in-javascript-function\/\">What is JavaScript Regex?<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/javascript-events-example\/\" aria-current=\"page\">JavaScript Events Example<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/how-to-create-a-preloader-in-javascript\/\" aria-current=\"page\">How to create a preloader in JavaScript?<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/foreach-method-in-javascript\/\" aria-current=\"page\">forEach method in JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/sorting-arrays-in-javascript\/\" aria-current=\"page\">Sorting Arrays in JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/what-is-linear-search-in-javascript\/\" aria-current=\"page\">Linear Search in JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/pagination-in-vanilla-javascript\/\" aria-current=\"page\">Pagination in Vanilla JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/transform-arrays-with-map-method\/\" aria-current=\"page\">Transform Arrays with Map() Method<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/how-to-change-an-elements-class-with-javascript\/\" aria-current=\"page\">How to change an element\u2019s class with JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/selection-sort-in-javascript\/\" aria-current=\"page\">Selection Sort in JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/select-all-text-in-div-with-a-mouse-click-in-javascript\/\" aria-current=\"page\">Select All Text in Div with a Mouse Click in JavaScript<\/a><\/li>\n<\/ul>\n<p>Let\u2019s take a look at a full example that better demonstrates how the idea of using\u00a0<code>localStorage<\/code>\u00a0to pass values between two HTML pages.<\/p>\n<p>Firstly, we need to a project setup with two HTML pages in the same folder:<\/p>\n<p>Below the HTML\/JavaScript code that need to placed in the <code>page1.html<\/code>\u00a0file:<\/p>\n<pre class=\"prettyprint\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;script&gt;\r\nfunction submitValue() {\r\n\/\/ Get the value entered by the user\r\nvar input = document.getElementById('value-input');\r\nvar value = input.value;\r\n\r\n\/\/ Store the value in localStorage\r\nlocalStorage.setItem('myValue', value);\r\n\r\n\/\/ Redirect to the second page\r\nwindow.location.href = 'page2.html';\r\n}\r\n&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;Page 1&lt;\/h1&gt;\r\n&lt;p&gt;Enter a value:&lt;\/p&gt;\r\n&lt;input type=\"text\" id=\"value-input\"&gt;\r\n&lt;button onclick=\"submitValue()\"&gt;Submit&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>This page asks the user for an input value and stores it in JavaScript\u2019s local database called\u00a0<code>localStorage<\/code>.<\/p>\n<p>And now the below code place in the in the <code>page2.html<\/code>\u00a0file:<\/p>\n<pre class=\"prettyprint\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;script&gt;\r\nwindow.onload = function() {\r\n\/\/ Get the value from localStorage\r\nvar value = localStorage.getItem('myValue');\r\n\r\n\/\/ Display the value on the page\r\nvar output = document.getElementById('value-output');\r\noutput.innerText = value;\r\n};\r\n&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;h1&gt;Page 2&lt;\/h1&gt;\r\n&lt;p&gt;The value you entered on the first page was:&lt;\/p&gt;\r\n&lt;p id=\"value-output\"&gt;&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h5><em><strong>If you want then buy a good, reliable, secure web\u00a0<a href=\"https:\/\/www.cloudsurph.com\/windows-vps-hosting\/\">hosting<\/a>\u00a0service \u00a0from here:\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">click here<\/a><\/strong><\/em><\/h5>\n<p>That\u2019s it. If you enjoyed reading this article and have more questions please reach out to our\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/submitticket.php?step=2&amp;deptid=1\">support team<\/a>\u00a0via live chat or\u00a0<a href=\"mailto:support@cloudsurph.com\">email<\/a>\u00a0and we would be glad to help you. we provide server\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting<\/a>\u00a0for all types of need and we can even get your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">server<\/a>\u00a0up and running with the service of your choice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Passing variables from one HTML page to another is a common task in web development. With JavaScript, you can easily pass variables between pages and create a more dynamic user experience. This tutorial will show you how to pass a variable from an HTML page to another using JavaScript. We&#8217;ll discuss the different ways of [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":5548,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[157,25,162,159,44,1],"tags":[54,47,105,103,48,113],"class_list":["post-5547","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos-7","category-web-hosting-virtualization","category-javascript","category-linux-server","category-kvm-xen","category-virtual-private-servers","tag-best-vps-hosting-server-maryland","tag-cheap-cloud-servers","tag-cheap-storage-server-hosting","tag-cheapest-vps","tag-dedicated-server-hosting-in-washington-d-c","tag-speed-test-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Pass Variables from HTML Page to Another with JavaScript<\/title>\n<meta name=\"description\" content=\"Learn how to pass variables from one HTML page to another using JavaScript, How to Pass Variables from an HTML Page to Another with JavaScript\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Pass Variables from HTML Page to Another with JavaScript\" \/>\n<meta property=\"og:description\" content=\"Learn how to pass variables from one HTML page to another using JavaScript, How to Pass Variables from an HTML Page to Another with JavaScript\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudsurph Web Hosting Washington D.C.\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CloudSurph\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-07T15:01:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-20T15:11:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/05\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1264\" \/>\n\t<meta property=\"og:image:height\" content=\"760\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rony\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cloudsurph\" \/>\n<meta name=\"twitter:site\" content=\"@Cloud_Surph\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rony\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/\"},\"author\":{\"name\":\"Rony\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\"},\"headline\":\"How to Pass Variables from an HTML Page to Another with JavaScript\",\"datePublished\":\"2023-05-07T15:01:12+00:00\",\"dateModified\":\"2023-05-20T15:11:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/\"},\"wordCount\":477,\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg\",\"keywords\":[\"Best VPS hosting server Maryland\",\"Cheap Cloud Servers\",\"Cheap Storage Server Hosting\",\"Cheapest VPS\",\"Dedicated Server Hosting in Washington D.C\",\"Speed test VPS\"],\"articleSection\":[\"CentOS 7\",\"Cloud Hosting\",\"JavaScript\",\"Linux Server\",\"Virtualization\",\"VPS Servers\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/\",\"name\":\"How to Pass Variables from HTML Page to Another with JavaScript\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg\",\"datePublished\":\"2023-05-07T15:01:12+00:00\",\"dateModified\":\"2023-05-20T15:11:32+00:00\",\"description\":\"Learn how to pass variables from one HTML page to another using JavaScript, How to Pass Variables from an HTML Page to Another with JavaScript\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg\",\"width\":1264,\"height\":760,\"caption\":\"How to Pass Variables from an HTML Page to Another with JavaScript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cloudsurph.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Pass Variables from an HTML Page to Another with JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"name\":\"Cloudsurph Web Hosting Washington D.C.\",\"description\":\"Dedicated Server Hosting\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.cloudsurph.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\",\"name\":\"CloudSurph Technology Solutions\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"width\":2348,\"height\":1692,\"caption\":\"CloudSurph Technology Solutions\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/CloudSurph\\\/\",\"https:\\\/\\\/x.com\\\/Cloud_Surph\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\",\"name\":\"Rony\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"caption\":\"Rony\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/cloudsurph\"],\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/author\\\/ron\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Pass Variables from HTML Page to Another with JavaScript","description":"Learn how to pass variables from one HTML page to another using JavaScript, How to Pass Variables from an HTML Page to Another with JavaScript","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:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/","og_locale":"en_US","og_type":"article","og_title":"How to Pass Variables from HTML Page to Another with JavaScript","og_description":"Learn how to pass variables from one HTML page to another using JavaScript, How to Pass Variables from an HTML Page to Another with JavaScript","og_url":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/","og_site_name":"Cloudsurph Web Hosting Washington D.C.","article_publisher":"https:\/\/www.facebook.com\/CloudSurph\/","article_published_time":"2023-05-07T15:01:12+00:00","article_modified_time":"2023-05-20T15:11:32+00:00","og_image":[{"width":1264,"height":760,"url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/05\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg","type":"image\/jpeg"}],"author":"Rony","twitter_card":"summary_large_image","twitter_creator":"@cloudsurph","twitter_site":"@Cloud_Surph","twitter_misc":{"Written by":"Rony","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/#article","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/"},"author":{"name":"Rony","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed"},"headline":"How to Pass Variables from an HTML Page to Another with JavaScript","datePublished":"2023-05-07T15:01:12+00:00","dateModified":"2023-05-20T15:11:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/"},"wordCount":477,"publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"image":{"@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/05\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg","keywords":["Best VPS hosting server Maryland","Cheap Cloud Servers","Cheap Storage Server Hosting","Cheapest VPS","Dedicated Server Hosting in Washington D.C","Speed test VPS"],"articleSection":["CentOS 7","Cloud Hosting","JavaScript","Linux Server","Virtualization","VPS Servers"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/","url":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/","name":"How to Pass Variables from HTML Page to Another with JavaScript","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/05\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg","datePublished":"2023-05-07T15:01:12+00:00","dateModified":"2023-05-20T15:11:32+00:00","description":"Learn how to pass variables from one HTML page to another using JavaScript, How to Pass Variables from an HTML Page to Another with JavaScript","breadcrumb":{"@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/#primaryimage","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/05\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/05\/How-to-Pass-Variables-from-an-HTML-Page-to-Another-with-JavaScript.jpg","width":1264,"height":760,"caption":"How to Pass Variables from an HTML Page to Another with JavaScript"},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudsurph.com\/how-to-pass-variables-from-an-html-page-to-another-with-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cloudsurph.com\/"},{"@type":"ListItem","position":2,"name":"How to Pass Variables from an HTML Page to Another with JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/www.cloudsurph.com\/#website","url":"https:\/\/www.cloudsurph.com\/","name":"Cloudsurph Web Hosting Washington D.C.","description":"Dedicated Server Hosting","publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cloudsurph.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.cloudsurph.com\/#organization","name":"CloudSurph Technology Solutions","url":"https:\/\/www.cloudsurph.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","width":2348,"height":1692,"caption":"CloudSurph Technology Solutions"},"image":{"@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CloudSurph\/","https:\/\/x.com\/Cloud_Surph"]},{"@type":"Person","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed","name":"Rony","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","caption":"Rony"},"sameAs":["https:\/\/x.com\/cloudsurph"],"url":"https:\/\/www.cloudsurph.com\/author\/ron\/"}]}},"_links":{"self":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/comments?post=5547"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5547\/revisions"}],"predecessor-version":[{"id":5549,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5547\/revisions\/5549"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media\/5548"}],"wp:attachment":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media?parent=5547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/categories?post=5547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/tags?post=5547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}