`<div class="check"><input type="checkbox" name="buy" value="260" checked="" onclick="javascript:basket.checkItem();"> </div>
this is element that I want to make by createElement(). I want to know is there anyway complete this in one command? length doesn't matter.
If you want a one-liner, you could use:
Object.assign(document.createElement('div'), {className: 'check', innerHTML: '<input type="checkbox" name="buy" value="260" checked="" onclick="javascript:basket.checkItem();"> '})
Or, better readable:
Object.assign(document.createElement('div'), {
className: 'check',
innerHTML: '<input type="checkbox" name="buy" value="260" checked="" onclick="javascript:basket.checkItem();"> '
})