x
 
<!DOCTYPE html>
<html>
<body>
<p id="demo" style="text-decoration:line-through;">这是示例段落。</p>
<button type="button" onclick="myFunction()">返回 p 的文本装饰</button>
<script>
function myFunction() {
  alert(document.getElementById("demo").style.textDecoration);
}
</script>
</body>
</html>