读取div中的选定值 - jQuery [英] read selected values in div - jQuery

查看:50
本文介绍了读取div中的选定值 - jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQuery中的

将自动完成文本框中的选定值绑定到div ....这是使用代码


  var data =" < div>< table width ='100%'>< tr>< td align ='right'>< div class ='close16'/>< / td>< / tr> < / table>< div>< table>< tr>< td rowspan ='4'width ='50px;'>< img src ='" + staffItem.Photo
+"'Width ='48'Height ='48'  />< / TD>< TD>" + staffItem.Name +" (< span class ='id'>" + staffItem.StaffId +"< / span>)< / td>< / tr>< tr>< td>< table cellpadding =' 0'cellspacing ='0'>< tr>< td>"
+ staffItem.Email +"< / td>< td>& nbsp; |& nbsp;< / td>< td>" + staffItem.Mobile +"< / td>< / tr>< / table>< / td>< / tr>< / table>< / td>< / tr>< /表>< / DIV>< / DIV> " ;;

            $('#staffInCharge')。css('background-color','#FFAA55');



       &NBSP;&NBSP;&NBSP;&NBSP;&NBSP; $('#staffInCharge')。追加(数据);



我需要将StaffIds单独推入数组,为此我得到一些建议,如上所述,为StaffId使用span标签,这里我的问题是如何将StaffIds单独推送到数组中....任何人都可以帮助我

解决方案

我巡航到MSDN ang搜索"jQuery" - 这是一个链接:


http://social.msdn.microsoft.com/Search/en-US?query=jQuery&Refinement=123&ac=3


请注意参考 http://jquery.com/  :)


Karl


in jQuery am binding the selected values from the autocomplete textbox, into a div....for this am using the code as

 var data = "<div><table width='100%'><tr><td align='right' ><div class='close16'/></td></tr></table><div><table><tr><td rowspan='4' width='50px;'><img src='" + staffItem.Photo + "' Width='48' Height='48'  /></td><td>" + staffItem.Name + " ( <span class='id'>" + staffItem.StaffId + " </span>)</td></tr><tr><td><table cellpadding='0' cellspacing='0'><tr><td>" + staffItem.Email + "</td><td>&nbsp;|&nbsp;</td><td>" + staffItem.Mobile + "</td></tr></table></td></tr></table></td></tr></table></div></div> ";
            $('#staffInCharge').css('background-color', '#FFAA55');

            $('#staffInCharge').append(data);

I need to push the StaffIds' alone into an array, for this I got some suggestion to use span tag for StaffId as I mentioned above, here my question is how can I push the StaffIds alone into a array....can anyone help me here

解决方案

I cruise over to MSDN ang search "jQuery" - here is a link that does that:

http://social.msdn.microsoft.com/Search/en-US?query=jQuery&Refinement=123&ac=3

Note the reference to http://jquery.com/ :)

Karl


这篇关于读取div中的选定值 - jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆