Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-text/word-spacing/word-spacing-animating-word-spacing.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<title>word-spacing animates when animating word-spacing</title>
<link rel="author" title="Sam Weinig" href="mailto:sam@webkit.org">
<link rel='help' href='https://www.w3.org/TR/css-text-3/#word-spacing'>
<link rel='match' href='reference/word-spacing-animating-word-spacing-ref.html'>
</head>
<body>
<div>The words below should be separated by 20 pixels.</div>
<div id="target">WORD WORD WORD</div>
<script>
const target = document.querySelector('#target');
const animation = target.animate({ wordSpacing: ['0px', '40px'] }, 40);
animation.pause();
animation.currentTime = 20;
</script>
</body>
</html>