How to pass data from HTML to onClick js function? [duplicate]

Solution
function clickHandler(data){
  console.log(data) //This will log the data from html button
}
function highlightText(words_to_highlight) {
    console.log('button pressed');
    console.log(words_to_highlight);
}