我想使用mootools setProperty方法更改锚标记的href属性
它可以在所有浏览器中工作,包括chrome和safari,但不能在iphone, ipad和android手机上工作。
。$('a').setProperty('href', '#');
也试过简单的javascript
document.getElementsByClassName("my-class")[0].setAttribute("href","#");
以上两个例子都适用于所有浏览器。
有人知道吗?
取决于mootools的版本。setProperty
在* AGES前已被弃用
从1.2开始,是.set('href', '#');
请记住$('a')
不是'选择所有锚'像在jquery。它是get element with id=a。选择document.getElements('a');
或$$('a')
的所有锚
*不符合惯例,它仍然在原型