-6

i want with Javascript after website load, automatic run one button click (so run button)

this is button information and i want this button run when website will be load

12
  • Call the event handler function on page load. Check DOMContentLoaded and window.onload.
    – Tushar
    Commented May 8, 2017 at 6:24
  • 2
    I want a girl with a short skirt and a long jacket - if you can't copy/paste 5 lines of html into a question, I can't be bothered clicking on an image of code Commented May 8, 2017 at 6:24
  • i dont know so javascript that i get it, i dont know what is DOMContentLoaded or window.onload
    – Kids TV
    Commented May 8, 2017 at 6:25
  • this is code: { <div class="author_likedin"> <div><button id="liked" class="likebuttonliked" onclick="timeInfo()">მოწონებულია</button></div> <div id="likedInfo"><p id="ptag"></p></div> </div> }
    – Kids TV
    Commented May 8, 2017 at 6:29
  • Please edit the question and add the code there. See How do I format my code blocks?
    – Tushar
    Commented May 8, 2017 at 6:30

1 Answer 1

0

Is this what you were looking for?

window.onload = timeInfo("automatically on load,");

function timeInfo(message) {
  console.log(message + " called function");
}

document.getElementById("liked").addEventListener("click", function() {
  timeInfo("clicking button");
});
<div class="author_other_button">
  <button id="liked" class="likebuttonliked">მოწონებულია</button>

</div>

1
  • thnx that it ; .................
    – Kids TV
    Commented May 8, 2017 at 7:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.