Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/cssom/style-element-inline-important.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Element CSS inline style with !important</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<p class="element-with-inline-style" style="word-spacing: 1px !important;">Inline Style Test</p>
<script>
"use strict";
test(() => {
const p = document.querySelector(".element-with-inline-style");
assert_equals(p.style.cssText, "word-spacing: 1px !important;", "cssText");
assert_equals(p.style.getPropertyValue("word-spacing"), "1px", "value");
assert_equals(p.style.getPropertyPriority("word-spacing"), "important", "priority");
});
</script>