hasAttribute(s) i Internet Explorer (IE)
- Data:
- 28 maj 2008
- Kategoria:
- Skrypty
Javascript-em możemy sprawdzić czy dany atrybut elementu istnieje za pomocą hasAttribute lub czy w ogóle element ma jakieś atrybuty hasAttributes. Niestety, Internet Explorer do wersji 7, nie zna tych funkcji. Jak z tego wyjść? Dla hasAttributes() użyj attributes.length > 0, a dla sprawdzenia czy dany atrybut istnieje, czyli hasAttribute(attrName), użyj getAttribute(attrName) !== null.
Twój komentarz
Kategorie
- Accessibility (17)
- Aktualności Ikeris (26)
- Artykuły (14)
- CSS (16)
- Flash (4)
- Grafika (2)
- HTML i XHTML (17)
- JavaScript (2)
- Oprogramowanie (9)
- Programowanie (26)
- Przeglądarki (28)
- Server side (6)
- Skrypty (12)
- Systemy (6)
- Usability (6)
- Wordpress (12)
Linki
