如:$('#test').bind('inputpropertychange',function(){varcc=$(this).val().length;alert(cc);});這個(gè)是綁定事件,如不需要用$(this).val().length就行或$('#test').val().length。

“專業(yè)、務(wù)實(shí)、高效、創(chuàng)新、把客戶的事當(dāng)成自己的事”是我們每一個(gè)人一直以來堅(jiān)持追求的企業(yè)文化。 創(chuàng)新互聯(lián)是您可以信賴的網(wǎng)站建設(shè)服務(wù)商、專業(yè)的互聯(lián)網(wǎng)服務(wù)提供商! 專注于成都網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、軟件開發(fā)、設(shè)計(jì)服務(wù)業(yè)務(wù)。我們始終堅(jiān)持以客戶需求為導(dǎo)向,結(jié)合用戶體驗(yàn)與視覺傳達(dá),提供有針對性的項(xiàng)目解決方案,提供專業(yè)性的建議,創(chuàng)新互聯(lián)建站將不斷地超越自我,追逐市場,引領(lǐng)市場!
用Jquery動(dòng)態(tài)添加控件并取值
html xmlns=""
head runat="server"
titleJquery動(dòng)態(tài)控件/title
script src="jquery-1.4.2.js" type="text/javascript"/script
script type="text/javascript"
$(function() {
var i = 2;
$('#addText').click(function() {
if (i 9) {
$('#main').append('divinput type="text" name="text" + i + ""/
a href="#" class="del-text"del/a/div');
i++;
} else {
alert("最多只能添加8個(gè)");
}
});
$('.del-text').live('click',function(){
$(this).parent().remove();
i--;
});
});
/script
/head
body
div id="main"
div
input type="text" name="text1" /
/div
/div
a id="addText" href="#"添加文本框/a
/body
/html
==========
取值的話,很簡單,在后臺(tái)直接用 Request["text" + i].ToString() 即可。
jquery實(shí)現(xiàn)動(dòng)態(tài)添加控件,刪除控件,頁面性能優(yōu)化
!DOCTYPE html
html
head
metacharset="UTF-8"
title/title
scriptsrc="js/jQuery.js"/script
styletype="text/css"
/style
/head
body
inputtype="text"placeholder="請輸入姓名"/
inputtype="text"placeholder="請輸入年齡"/
inputtype="text"placeholder="請輸入性別"/
inputtype="button"value="注冊" /
inputtype="text"placeholder="請輸入搜索內(nèi)容"/
inputtype="button"value="搜索" /
inputtype="button"value="清除" /
divclass="divClass"/div
/body
scripttype="text/JavaScript"
$('input[value=注冊]').click(function(){
// 獲取輸入框中的內(nèi)容
varname = $('input[placeholder=請輸入姓名]').val();
varage = $('input[placeholder=請輸入年齡]').val();
varman = $('input[placeholder=請輸入性別]').val();
// 把輸入框中的內(nèi)容清空
$('input[placeholder=請輸入姓名]').val('');
$('input[placeholder=請輸入年齡]').val('');
$('input[placeholder=請輸入性別]').val('');
// 創(chuàng)建新的控件
var$wrap = $('div/div');
var$name = $('span/span');
var$age = $('span/span');
var$man = $('span/span');
var$del = $('input type="button" value="刪除" /');
$wrap.css({
'border':'1px red solid ',
width:'700px'
})
$name.text(name);
$age.text(age);
$man.text(man);
// 添加控件到瀏覽器
$('.divClass').append($wrap);
$wrap.append($name);
$wrap.append($age);
$wrap.append($man);
$wrap.append($del);
$('span').css('padding','10px 50px');
$wrap.css('padding','20px 0');
})
// 搜索功能
$('input[value=搜索]').click(function(){
varcontent = $('input[placeholder=請輸入搜索內(nèi)容]').val();
$('input[placeholder=請輸入搜索內(nèi)容]').val('');
$.each($('span'),function(index,value){
if(content== value.innerText){
$('span').eq(index).css('background','red')
}
})
})
// 清除選中顏色的功能
$('input[value=清除]').click(function(){
$.each($('span'),function(index,value){
value.style.background = '';
})
})
// 刪除功能
$('.divClass').on('click',function(event){
if(event.target.value== "刪除"){
$(event.target).parent().remove();
}
})
/script
/html
首先textarea是純文本編輯,是無法實(shí)現(xiàn)圖片類表情的。字符類表情是ok的,直接輸入相應(yīng)字符即可。
然后,如果想實(shí)現(xiàn)圖片類表情,需要使用富文本編輯器,你可以了解下fck之類的編輯器。
自己實(shí)現(xiàn)也可以,有一定的技術(shù)復(fù)雜度。
一、打開【設(shè)置】選項(xiàng),在【通用】中找到【鍵盤】。 二、選擇【添加新鍵盤】。 三、找到【表情符號】,點(diǎn)擊即可添加。然后你便可以在鍵盤中點(diǎn)擊“小地球”快速切換到表情文字鍵盤。
把jquery.qqFace.js中的:
$('#'+id).css('top',top); 改成$('#'+id).css('bottom',top);
網(wǎng)站名稱:表情jquery,表情包 搞笑 沙雕
文章路徑:http://chinadenli.net/article27/dsshijj.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、網(wǎng)站排名、響應(yīng)式網(wǎng)站、移動(dòng)網(wǎng)站建設(shè)、企業(yè)網(wǎng)站制作、全網(wǎng)營銷推廣
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)