32 lines
781 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
The use of DOM attributes that are only supported by specific browsers can doom your website to obsolescence as the browser market shifts or the vendor that introduced the extension abandons it. Instead, it's always best to stick to standard attributes so that your site works for as broad a cross section of users as possible.
This rule raises an issue when ``++innerText++`` is used.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
function setData(element) {
element.innerText = "Hello World!"; // Noncompliant
}
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
function setData(element) {
element.textContent = "Hello World!";
}
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]