Javascript 用于拉取的正则表达式或函数<;a></a>;突然

Javascript 用于拉取的正则表达式或函数<;a></a>;突然,javascript,reactjs,Javascript,Reactjs,我正在使用React&Typsescript。我有一个来自API的文本块,我需要从中提取标记,这样我就可以点击它来报告信息(知道什么时候有人点击它)。我正在考虑创建一个变量,我可以将a标记设置为,然后在其上单击一次。以下是代码块: "<div id="wfText"> <p>In order to view your available regional sports network and local channels, you have to be located w

我正在使用React&Typsescript。我有一个来自API的文本块,我需要从中提取标记,这样我就可以点击它来报告信息(知道什么时候有人点击它)。我正在考虑创建一个变量,我可以将a标记设置为,然后在其上单击一次。以下是代码块:

"<div id="wfText">
<p>In order to view your available regional sports network and local channels, you have to be located within your billing zip code.</p><ul><li>Sometimes even though you are located within your billing zip code, your internet provider routes the internet service through a different zip code. The DIRECTV NOW app uses the zip code provided by them to determine location. 
</li>
</ul>
<div>
<a id="link" data-toggle="collapse" data-target="#par1" class="kbarticle-expandable collapsed"> <span style="vertical-align: -webkit-baseline-middle;">View Available Channels</span> </a><div id="par1" class="collapse" style="background: none; height: 0px;"><p>If you are registering in a different zip code than your billing zip code, to see what channels are available for you to view:</p><ol><li>Go to 

<a target="_blank" href="https://www.directv.com/rsnlocalchannels">directv.com/rsnlocalchannels</a>

</li><li>Enter your billing zip code and review the channels available. </li><li>Enter the zip code for the area you are registered in and look for networks that match the ones available with your billing zip code. </li></ol><p>If you don&#39;t see the same network on both lists then there will not be a local channel available for that network.</p></div></div><p>Issue resolved?</p>"
”
为了查看您可用的区域体育网络和本地频道,您必须位于您的计费邮政编码内。

  • 有时,即使您位于您的计费邮政编码内,您的互联网提供商也会通过不同的邮政编码路由互联网服务。DIRECTV NOW应用程序使用他们提供的邮政编码确定位置。
  • 输入您的计费邮政编码并查看可用的频道。
  • 输入您注册的地区的邮政编码,并查找与您的计费邮政编码匹配的网络。
  • 如果您在两个列表上看不到相同的网络,则该网络将没有可用的本地频道。

    I问题是否已解决?

    我需要得到那个动态的链接,并在它上面点击链接到另一个函数。是否有人知道正则表达式或操纵此字符串以提取及其所有内容的方法?需要帮助吗 函数createElement(html,elem=“div”){ 常量元素=document.createElement(elem); element.innerHTML=html 返回元素 } 常量html=` 为了查看您可用的区域体育网络和本地频道,您必须位于您的计费邮政编码内。

    • 有时,即使您位于您的计费邮政编码内,您的互联网提供商也会通过不同的邮政编码路由互联网服务。DIRECTV NOW应用程序使用他们提供的邮政编码来确定位置。
  • 输入您的账单邮政编码并查看可用的频道
  • 输入您注册所在地区的邮政编码,并查找与您的计费邮政编码匹配的网络问题已解决?

    `
    console.log(createElement(html).querySelector(“a”))Use我不能使用任何第三方软件包