Get value of div content using jquery

后端 未结 5 1778
轮回少年
轮回少年 2020-11-28 11:09

I have the following html and I want to get the value of the div which is \"Other\" How can I do this with jQuery?

 
5条回答
  •  被撕碎了的回忆
    2020-11-28 11:40

    Try this to get value of div content using jquery.

        $(".showplaintext").click(function(){
            alert($(".plain").text());
        });
        
        // Show text content of formatted paragraph
        $(".showformattedtext").click(function(){
            alert($(".formatted").text());
        });
    
    

    Exploring the zoo, we saw every kangaroo jump and quite a few carried babies.

    Exploring the zoo, we saw every kangaroo jump and quite a few carried babies.

    Taken from @ Get the text inside an element using jQuery

提交回复
热议问题