开发者

get text from textbox and textarea and save in cookie value using jquery or javascript

I have one textbox and one textarea. I want to save the text whatever I entered in that textbox but that textbox is in I开发者_如何学运维frame.

How I do it using jquery or javascript?

Please help me.


Use jQuery.cookie plugin to work with cookies.

$("#myframe").contents().find('#textboxid').blur(function() {
   $.cookie('textboxvalue', $(this).val()); // for storing
});

Where myframe id of the frame and textboxid id of the textbox inside of iframe.


window.localStorage is another option working on IE8+, modern browsers without the 4K ceiling:

localStorage['textareaKey'] = $('#textarea').val();

$('#textarea').val(localStorage['textareakey']);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜