Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: JavaScript:IDで要素を削除
私はそれぞれのIDしか知らず、親ノードについて具体的には知りません。
You can use parentNode on the element to get its parent, and use removeChild on it.
parentNode
removeChild
var el = document.getElementById( 'id' ); el.parentNode.removeChild( el );
jQueryでは、$('#your_id').remove();うまくいきます。
$('#your_id').remove();