JAVASCRIPT set cookies javascript - Net-Raft.com

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




Just a Web Code Solution

how do I set the cookies using javascript ?


 95

JAVASCRIPT


0

<!DOCTYPE html>
<html>
<head>
</head>

<body>

<input type="text" id="MyText">

<button id="btn4" onclick="mySave()">save</button>

<script type="text/javascript">

var MyValue = document.getElementById("MyText");
var x = document.cookie;
MyValue.value = x;

function mySave() {

var MyValue = document.getElementById("MyText").value;
document.cookie = MyValue + "; expires=Thu, 2 Apr 2017 12:00:00 UTC";
var x = document.cookie;

alert("saved");

}

</script>

</body>
</html>


By     Created   
The power of the user (%)
9%



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 ...

  4.7K     383

get client hostname javascriptget client hostname javascriptJAVASCRIPT

Click to see more ...

  2.5K     254

detect ie javascriptdetect ie javascriptJAVASCRIPT

Click to see more ...

  1.5K     159

Create fireworks using javascriptCreate fireworks using javascriptJAVASCRIPT

Click to see more ...

  1.4K     113

create 3d barrel using javascriptcreate 3d barrel using javascriptJAVASCRIPT

Click to see more ...

  1.3K     83

get ip address javascriptget ip address javascriptJAVASCRIPT

Click to see more ...

  768     74

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

Click to see more ...

  739     73

create qr code javascriptcreate qr code javascriptJAVASCRIPT

Click to see more ...

  536     71

how to create the connect to a database with ADODB using javascript ?how to create the connect to a database with ADODB using javascript ?JAVASCRIPT

Click to see more ...

  475     59

get filename using javascript get filename using javascript JAVASCRIPT

Click to see more ...

  446     56