Change the font color for the text element named "Text1" on the current page.

Note

An element name can be changed from the "name change description" for the element. Refer to the following for details. ▶ Web Author screen layout

  <html>
  <head>
    <script src="wplayer-api.1.0.0.js"></script>        
    <script>
      const contentPropertyType = $wp.content.getPropertyType();
      $wp.content.getPage().getElement('Text1').setProperty(contentPropertyType.FONTCOLOR,"rgba(255, 0, 0, 1)");
    </script>
  </head>    
  </html>