title: Local JS in WebView
body: <p>I searched a lot and I didn't find a working solution. I want to execute local JS code in my WebView.
  There is a way to accomplish this?
  This is the code I tried:</p>
  
  <pre><code>class Graph extends Component {
  
      render() {
          let html = `
  &lt;HTML&gt;
  &lt;HEAD&gt;
      &lt;link rel="stylesheet" href="styles.css"&gt;
      &lt;TITLE&gt; Sample Web Page &lt;/TITLE&gt;
  &lt;/HEAD&gt;
  &lt;BODY&gt;
  &lt;H1&gt; THIS IS SAMPLE HEADING IN WEBPAGE. &lt;/H1&gt;
      &lt;div id="myContent"&gt;This is my name&lt;/div&gt;
    &lt;script&gt;
        document.querySelector("#myContent").style.backgroundColor = "red"
      &lt;/script&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  `;
          return (
              &lt;View style={{flex: 1}}&gt;
              &lt;WebView
                  style={styles.WebViewStyle}
                  source={{html: html}}
                  javaScriptEnabled={true}
                  domStorageEnabled={true}  /&gt;
              &lt;/View&gt;
  
          );
      }
  }
  
  const styles = StyleSheet.create({
      WebViewStyle:
          {
              justifyContent: 'center',
              alignItems: 'center',
              flex:1,
              marginTop: (Platform.OS) === 'ios' ? 20 : 0
          }
  });
  </code></pre>