How can i fetch the html content inside div with class=container in angular2 : I want to fetch the **HTML** content inside the class 'container'. After searching i am able to write some code but i have not been able to fetch the html content needed. Please help 

>It will be better if i can do it using id than class

my `edit.component.ts` function is shown below-

    selectDiv() {
         //create a new HTMLElement from nativeElement
        var hElement: HTMLElement = this.elRef.nativeElement;
    
        //now you can simply get your elements with their class name
        var allDivs = hElement.getElementsByClassName('container');
    
        //do something with selected elements
        console.log(allDivs);
      }

my `edit.component.html` code is below:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <button (click)="selectDiv()">select div</button>
    
       <div id="container" class="container">   
    <p id="alert" contenteditable="true">
     EDIT ME
    </p>
    </div>