Can we use onClick event to call a function defined either in model or view? Something like showHideText() function in below code. If yes then is it correctly called in below code(in .hbs file)?
Code in HBS file:
<img onclick="showHideText()" src="{{_graphic.src}}" data-large="{{_graphic.large}}" data-small="{{_graphic.small}}" {{#if _graphic.alt}}aria-label="{{_graphic.alt}}"{{else}}aria-hidden="true"{{/if}} />
Function defined in Model or View JS file of the component
showHideText: function(){
console.log("The function is called when user clicked on the image.");
}