CSS&JS/👀Study and Copy
$(el).siblings(); 를 vanilla JS로 구현하기 (자바스크립트 siblings() 대체)
arancia_
2021. 3. 10. 10:27
참고사이트
vanillajstoolkit.com/helpers/getsiblings/
getSiblings.js
/*! * Get all siblings of an element * (c) 2018 Chris Ferdinandi, MIT License, https://gomakethings.com * @param {Node} elem The element * @return {Array} The siblings */ var getSiblings = function (elem) { return Array.prototype.filter.call(elem.parentNod
vanillajstoolkit.com
github.com/nefe/You-Dont-Need-jQuery/blob/master/README.ko-KR.md
nefe/You-Dont-Need-jQuery
Examples of how to do query, style, dom, ajax, event etc like jQuery with plain javascript. - nefe/You-Dont-Need-jQuery
github.com
화면
HTML, JS
let myVar = Array.prototype.filter.call(el.parentElement.children, function(e){ return e !== el;});
소스코드