attr标题不适用于ipad

时间:2016-07-06 08:26:34

标签: jquery ipad attr

这是我的代码

def str_upper2(string):

    return "".join(s[0].upper() + s[1:] for s in string.split('*'))

这段代码在PC上运行良好,但在ipad上运行不正常。

我尝试使用以下代码$(this).children().attr('title'); 标记<a>预览)

class

再次适用于PC但不适用于ipad

$(this).children().prop('title'); $(this).children(".preview").attr('title'); $(this).find(".preview").attr('title'); $(this).find("a").attr('title'); title无法在ipad上运行吗? 我有像this这样的类似问题。

注意:HTML / JQuery代码看起来没什么问题因为我已经尝试过所有的PC浏览器甚至Safari。它工作正常。

1 个答案:

答案 0 :(得分:0)

我知道这是一个奇怪的答案。 问题在于ipad中title attr本身。我试着提醒那个DOM的类(.preview)。它也在ipad上发出警告,但警告Ipad上的标题是空白的,不知道为什么。

我现在所做的是为我所需的值创建数据属性并使用

获取

$(this).children().attr('data-colorname');

以上代码现在也适用于Ipad:|