jQuery .Text在Firefox 10中不起作用 [英] Jquery .Text not working in firefox 10

查看:55
本文介绍了jQuery .Text在Firefox 10中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取以下代码的Text(Title)

Am trying to get the Text(Title) of below code

<h6 id="test">Title</h6>

使用JQUERY $(test).text()

它在Firefox 10版本中不起作用,在其他地方也可以工作.

It is not working in Firefox 10 version and it working else where.

我需要更改任何内容吗?

Do i need to change anything ?

谢谢

推荐答案

您需要添加#来选择具有与

You need to add a # to select elements with an HTML id attribute matching the value as described in the CSS Selectors documentation.

因此使用:

$('#test').text()
   ^
  add a # here

这篇关于jQuery .Text在Firefox 10中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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