JAVASCRIPT create session storage javascript - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution
join us

how to create session storage using javascript ?


 142

Show ResultJAVASCRIPT


1

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
</head>

<body>

<div id="MyColor">Hello world!</div>

<button id="btn1">red</button></br>
<button id="btn2">blue</button></br>
<button id="btn3">yellow</button></br>
<button id="btn4">save</button>

<script type="text/javascript">

$(document).ready(function () {

var SetColor = sessionStorage.getItem("font_color");
$("#MyColor").css("color", SetColor);


$("#btn1").click(function () {

$("#MyColor").css("color", "red");

});

$("#btn2").click(function () {

$("#MyColor").css("color", "blue");

});

$("#btn3").click(function () {

$("#MyColor").css("color", "yellow");

});

$("#btn4").click(function () {

var theColorIs = $('#MyColor').css("color");

sessionStorage.setItem("font_color", theColorIs)

});

});

</script>

</body>
</html>


By        
The power of the user (%)
12%



The most helpful JAVASCRIPT solutions

How to get client machine name or computer name with javascript ?How to get client machine name or computer name with javascript ?JAVASCRIPT

Click to see more ...

  15.8K     395

get client hostname javascriptget client hostname javascriptJAVASCRIPT

Click to see more ...

  4.4K     290

create 3d barrel using javascriptcreate 3d barrel using javascriptJAVASCRIPT

Click to see more ...

  3.2K     249

create qr code javascriptcreate qr code javascriptJAVASCRIPT

Click to see more ...

  2.4K     197

detect ie javascriptdetect ie javascriptJAVASCRIPT

Click to see more ...

  2.7K     194

Create fireworks using javascriptCreate fireworks using javascriptJAVASCRIPT

Click to see more ...

  2.8K     183

How can I get the last day and the next day in javascript ?How can I get the last day and the next day in javascript ?JAVASCRIPT

Click to see more ...

  2.4K     178

fire event when user is idle javascriptfire event when user is idle javascriptJAVASCRIPT

Click to see more ...

  2.4K     179

create earth in universe with three.jscreate earth in universe with three.jsJAVASCRIPT

Click to see more ...

  2.2K     176

how to create foreach class using javascript ?how to create foreach class using javascript ?JAVASCRIPT

Click to see more ...

  2K     174

Welcome aboard!
We are happy you are here and
wish you good net-raft!