Run ยป
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> </head> <body> <div class="col-md-2 content-article-detail"> <p>This is content of article</p> </div> <script> var text = $(".content-article-detail").text(); var content = $(".content-article-detail").html(); alert(text); alert(content); </script> </body> </html