How to extract text from Link in Javascript?

后端 未结 4 452
鱼传尺愫
鱼传尺愫 2021-01-27 14:08

I have following string:

StackOverFlow

How can I extract text (i.e. StackOver

4条回答
  •  情歌与酒
    2021-01-27 14:50

    If you can add an id to your link like so: `StackOverFlow" then you can get the text like this:

    document.getElementById('linkID').innerHTML;

提交回复
热议问题