localstorage.setitem

I have HTML code :

<html>
<head>

<title>Login page</title>
</head>
<script type="text/javascript">
	localStorage.setItem("detail", "false");
function display(form){
	if (form.username.value=="root") { 
		if (form.password.value=="root") {
			location="page2.html" 
			localStorage.setItem("detail", "true");
		} 
		else {
			alert("Invalid Password")
		}
	} 
	else {  
		alert("Invalid Username")
	}
}
</script>			
<body >
<center>
<form >
Username : <input type="text" name="username" />


Password :  <input type="password" name="password"/>


<input type="button" value="Login" onClick="display(this.form)"/>
</form>
</center>
</body>
</html>

This code for login page, Now when login credentials will right than it will go to page2.html.

page2.html :

<html>
<head>
  
</head>

<body>
    <h1>
      the value for number is:
      <script type="text/javascript">
        document.write(number)
      </script>
    </h1>
    <input type='button' value='Login' onClick='display(this.form)' style='border-radius:0.5em;background:#558ED5;padding:0.3em 0.3em;width:20%;color:white;font-size:130%;' />
</body>

<script type='text/javascript'>
    var number = localStorage.getItem('detail');
    window.onload = function display(form){
	if (number == 'true') { 
			alert('Ready')
			localStorage.setItem('detail', 'false');
		} 
	else if (number == 'false') {
			alert('Enter Details')
			location='page1.html'
		}
	}

  </script>
</html>

So just want to know that in arduino " localStorage.setItem(‘xxxxx’, ‘xxxxx’); " will work or not ?

in chrome it is working fine but I didn’t get output in arduino. can any one suggest me this will work on arduino or not ?

You need to be a bit more specific what you are doing with the Arduino. Your post is just HTML code. Arduino do not run an operating system and a browser with a web engine like a PC, smartphone or tablet does. If you have a web application running on an Arduino, all the processing of the HTTP is done in simple C code. How sophisticated that code is, is up to you.

This library I used and add one page for login.
I just want to add prevention of writing url directly.

So I just want to know that localStorage.setItem('xxxxx', 'xxxxx'); will work on arduino or not ?

If possible save those 2 html page and try to understand what I want.

Thanks in advance.