Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
</head>
<body>
<input type="text" id="input1" placeholder="put some text"></br>
<button class="btn1">create cookies</button></br>
<button class="btn2">remove cookies</button>
<script>
$(document).ready(function () {
if (typeof $.cookie('net_raft_c') === 'undefined') {
} else {
$("#input1").val($.cookie("net_raft_c"));
}
$(".btn1").click(function () {
$.cookie('net_raft_c',"" + $("#input1").val() + "", { expires: 365, path: '/' });
});
$(".btn2").click(function () {
$.removeCookie('net_raft_c', { path: '/' });
});
});
</script>
</body>
</html>
The most helpful JQUERY solutions
plugin get client ip address using jqueryJQUERY Click to see more ... 10.8K 1.8K