How to replace innerHTML of a div using jQuery?

前端 未结 13 1694
北恋
北恋 2020-11-22 11:57

How could I achieve the following:

document.all.regTitle.innerHTML = \'Hello World\';

Using jQuery where regTitle is my di

相关标签:
13条回答
  • 2020-11-22 12:35

    Example

    $( document ).ready(function() {
      $('.msg').html('hello world');
    });
        <!DOCTYPE html>
        <html>
          <head>
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>    
          </head>
          <body>
            <div class="msg"></div>
          </body>
        </html>

    0 讨论(0)
提交回复
热议问题