Javascript Code Snippets for Newbies
初学者のための JavaScript コードスニペット集
登録しているスニペット一覧
getid : Get Element by id
const name = document.getElementById('');
getcl : Get Elements by className
const name = document.getElementsByClassName('');
qs : Query Selector
const name = document.querySelector('.class');
addev : Add Event-Listener
.addEventListener('event', () => {
});
func()=> : Arrow Function
const name = () => {};
func() : Function Statement
function name() {}
3?: : Ternary (Conditional) Operator
condition ? '' : '';
※ condition は「条件」を意味します
| |