Message from JavaScript discussions

July 2017

— Or a function that calls it


Wew, this all make me confused,
well, last question, hope you doesnt bothered and can help me TRGWII
i have change the code to this :
function bukapaket() {
document.querySelector('#coreNavigator').pushPage('harga.html');'ons-toolbar .center').innerHTML = el.nama;
console.log("ID dari halaman ini adalah "" , dan Nama dari halaman ini adalah "+el.nama+" , dan ini adalah Halaman Harga");

why that .innerHTML resulted as null but that el.nama appear in console.log ?

— Uhhh, why use

— And please don't use innerHTML

— Use .textContent

— Erm, is from a mobile framework that i used i think 😅 i doesn't know if that is from native js or customized one.

Message permanent page

— Wait, gonna try that textcontext

— Textcontent*

— Replace with document ?

— Uncaught TypeError: Cannot set property 'textContent' of null 🤔
replace with document.getElementByClassName?

Message permanent page

— document.querySelector('').textContent = el.nama;

— Well, no error, but the object isnt change.