Home > Web Front-end > JS Tutorial > body text

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

小云云
Release: 2018-03-12 10:17:09
Original
3297 people have browsed it

This article mainly shares with you a vue.js method of obtaining text information of the current element. It has a good reference value and I hope it can help everyone.

1. Get the currently clicked content

  • 1. 关于公众号使用问题
  • Copy after login

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

     problem1: function(e){
       console.log(e.target.innerText);
     }
    Copy after login

    This is ok

    2. Chinese judgment

    Note: The character set must be correct, for example, they are all utf-8, or gbk. Otherwise the judgment will be wrong.

    The above is the detailed content of How to get the text information of the current element in vue.js. For more information, please follow other related articles on the PHP Chinese website!

    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!