user2422414
user2422414

Reputation: 75

Calling function from another javascript in html

I have a html input button which calling this function

<button class="Go" onClick="go();" disabled><div class="inner first">Nah...Not Yet</div></button>

But this script I created in another javascript which code like this name "test.js"

function go()
{
    window.location.href = 'https://google.com';   
}

How should I input the scriptype for the input button in order to call this function?

Upvotes: 1

Views: 39

Answers (1)

Nicolas M
Nicolas M

Reputation: 81

You should add a tag in your html, and all will be fine

<script type="text/javascript" src="test.js">

Upvotes: 1

Related Questions