Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to get the text information of the current element in vue.js

Shulou Source: shulou.com Published: 2022-05-31 13:24:42 09月24日 Update

This article introduces the knowledge of "how to get the text information of the current elements in vue.js". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Get the content of the current click

1. On the use of official account

When I click on the li tag, I want to get the text in the span. I can use this method:

Problem1: function (e) {console.log (e.target.innerText);}

It's ok like this.

2. Chinese judgment

Note: the character set must be correct, such as utf-8 or gbk. Or the judgment will be wrong.

This is the end of the content of how to get the text information of the current element in vue.js. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Text content information elements more knowledge practicality achievement next public dilemma character character set reality situation article method time label appearance Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information NVidia MySQL Shulou Technology Shulou Tech Info