I am using this fancy little JavaScript to highlight a field as the user hovers over it. Could you please tell me if there is a way of adding an onclick
functio
try
location = url;
function url() {
location = 'https://example.com';
}
<input type="button" value="Inline"
onclick="location='https://example.com'" />
<input type="button" value="URL()"
onclick="url()" />
If you would like to open link in a new tab, you can:
$("a#thing_to_click").on('click',function(){
window.open('https://yoururl.com', '_blank');
});
function URL() {
location.href = 'http://your.url.here';
}