Hi,
I’m having trouble with dynamically changing the title attribute of the ion-tab tag. I want to change the title with javascript, because the title has to show the date of today and some days earlier.
I am using the sidemenu template from Ionic, which I changed a bit. In browse.html I have added the ion-tabs and ion-tab interface, this is working perfectly. I have given the ion-tab an ID “today”, like this:
Using a button i’m calling a javascript function myFunction(). In index.html I have placed this javascript code:
The function is being called, but the title doesn’t change.
I’ve also tried this:
document.getElementById(‘today’).setAttribute(‘title’, ‘test 1’);
But no results. I’ve also tried this:
var n = document.getElementById(‘today’).title;
But n stays empty.
I can’t figure out what is the problem here. Can anybody help me with this?
Greetings,
Michel