I like to change the title of the div using the onclick function. I'm new to .js
function changeTitle() { document.getElementById("amul").attr('title', 'Item Added'); }
This is the enter button where I inserted my onclick function
<input type="button" class="button2" id="item1" value="Add to Cart" title="Add to Cart" onClick="addItem_check('item_listing_100','ItemTable','100','Amul Butter','500','g','150.00','1','kg','200.00','2','kg','250.00'); amul.style.backgroundColor='#c2ed5c'; if(this.value=='Add to Cart') {this.value = 'Remove from Cart'}; item1(); "/>
This is the div I like to change the title
<div class="center_prod_box" id="amul">. . . </div>
Zain source share