.val() works on input elements (or any element with a value attribute?) and .text() will not work on input elements.  .val() gets the value of the input element -- regardless of type. .text() gets the innerText (not HTML) of all the matched elements:

.text()

The result is a string that contains the combined text contents of all matched elements. This method works on both HTML and XML documents. Cannot be used on input elements. For input field text use the val attribute.

.val()

Get the content of the value attribute of the first matched element

最新文章

  1. zabbix 自定义探索规则发现服务器上面的kvm虚拟机和对应的网卡
  2. Java学习笔记一——安装JDK并配置环境变量
  3. yii过滤xss代码,防止sql注入
  4. UVALive 5905 Pool Construction 最小割,s-t割性质 难度:3
  5. app与服务器对接
  6. BFS 模板
  7. Linux vi 中搜索关键字
  8. win7下.NET 2.0未在web服务器上注册的问题(转)
  9. JavaScript 字符串
  10. scrapy中运行爬虫时出现twisted critical unhandled error错误
  11. java 对象赋值问题
  12. 左右GNU Linux企业加密文件系统 eCryptfs简介
  13. Docker存储
  14. ExtJs 思维导图
  15. openGPS.cn - 高精度IP定位原理,定位误差说明
  16. Linux----------Openssh介绍以及用法
  17. 软工网络15团队作业4——Alpha阶段敏捷冲刺4.0
  18. SystemC_Basic
  19. JS获取元素宽高的两种情况
  20. CodeForce 832A Sasha and Sticks

热门文章

  1. linux内核同步之每CPU变量、原子操作、内存屏障、自旋锁【转】
  2. 跟我一起写 Makefile(一)【转】
  3. sprintf,snprintf的用法(可以作为linux中itoa函数的补充)【转】
  4. pymysql 线程安全pymysqlpool
  5. 智联招聘的python岗位数据结巴分词(二)
  6. jQuery插件--zTree中点击节点实现页面跳转时弹出两个页面的问题
  7. hadoop3.1伪分布式部署
  8. 磁盘挂载MOUNT 445问题集
  9. [BZOJ3027][Ceoi2004]Sweet 容斥+组合数
  10. CodeFirst模式开发涉及到mysql简单使用