謝晒的PHP網頁設計
聯絡E-mail:
sean0704@gmail.com
站內搜尋
Thursday, February 4, 2016
[JavaScript][jQuery] 如何自動取代表單中的單引號及雙引號 (使用replace)
$("input[name='myinput[]']").each(function() {
var new_var = $(this).val().replace(/"/ig, '`').replace(/'/ig, '`');
$(this).val(new_var);
});
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment