I am currently experimenting with angular2 and I have a need to alter the value of a div- I want to change all contenteditable="false" to contenteditable="true" on my HTML page.
Note that at times the contenteditable="false" attribute may be added to a DIV tag, P tag, h1 tag, or some other element.
This is how the html appears:
<button (click)="selectDiv()">select div</button>
<section>
<div class="content">
<h1 contenteditable="false" >Resize your browser and see how they adapt.</h1>
<h1 contenteditable="false" >text2.</h1>
</div>
<div class="content" contenteditable="false">
<p>Content 2.</p>
<h1>text2.</h1>
</div>
</section>
I need guidance on what code I should include in explore.ts
so that when the button is clicked and selectDiv()
is called, the function will execute and convert all instances of contenteditable="false" to "true"
Please keep in mind that there could be any number of contenteditable="false" occurrences in my code.
selectDiv(){
//what should i write here
}