使用jquery将数据添加到td [英] add data to td using jquery

查看:423
本文介绍了使用jquery将数据添加到td的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hai ...

我开发了一个聊天应用程序..因为我需要在一个td表格中显示名称,在另一个td中显示图像...



我的代码在设计中是这样的..



 <   div     id   =  chatList >  
< 表格 >
< tr >
< td id = showUsernames >
< / td >
< td id = forimage >
< / td >
< / tr >
< / table >

< / div >







所以...在showUsernames id我必须得到名字和forimage id我必须显示图像...我想在jquery中做这个..请帮助我..

解决方案

jquery



('#showUsernames')。text()


('#forimage')。text()



最大的问题是你必须确保元素id是唯一的。


hai...
Iam developing a chat application..for that i need to display name in one td of table tr and image in another td..

my code is like this in design..

<div id="chatList">
                   <table>
                   <tr>
                   <td id="showUsernames">
                   </td>
                   <td id="forimage">
                   </td>
                   </tr>
                   </table>
                 
                   </div>




so...in showUsernames id i have to get name and in forimage id i have to display image...i wanted to do this in jquery..please help me..

解决方案

jquery


('#showUsernames').text()


('#forimage').text()

the biggest question is that you must ensure the element id is unique .


这篇关于使用jquery将数据添加到td的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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