jQuery.html() – pure JavaScript

jQuery('.selector').html('new content');

can be written in pure js like this

document.querySelector('.selector').innerHTML = 'new content';

or, if the selector is an id

document.getElementByID('selector').innerHTML = 'new content';

Schreibe einen Kommentar