Vanilla JavaScript instead of jQuery - ready, on, click and end selector

Viewed 10539

I have in jQuery:

$(document).ready(function() {
   $(document).on('click', "[id$='someId']", function () {
      console.log($(this).val());
   })
})

How can I write it in pure JavaScript?

$(document).ready(function()

Should I use "ready" in pure JavaScript?

$(document).on

How can I use "on"? I have to add dynamic elements, so in jQuery I must use "on".

I would like write this in accordance with ES6.

2 Answers
Related