I am new to java script and I am practicing it and got stuck with a situation. Here, I want to print different ids of all the elements in HTML with same name. I used getElementsByName() method but after getting elements I don't know how to print them on scree. For your reference, Here is the code which I tried.
function showID(){
var circleName= document.getElementsByName("Circle");
document.write(circleName.id);
<button onclick="showID()" name="Circle" id="core">Inner</button>
<button onclick="showID()" name="Circle" id="shell">Shell</button>
<button onclick="showID()" name="Circle"id="surface">Surface</button>