在TinyMCE中将样式应用于父元素

问题描述

如果有子标签,我需要将一个添加到p标签,如下所示:

function myFunction() {
  var input,filter,table,tr,td,i,txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toupperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toupperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }       
  }
}

我尝试以下操作均未成功(这是EPiServer中的C#):

<p class="read-more-link">
  <a href="#">Link</a>
</p>

有人知道如何解决这个问题吗?

解决方法

您应该使用包装器,请参见https://www.tiny.cloud/docs/configure/content-formatting/#wrapper

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...