#i have three buttons and when they click that button, they will be redirected to an another html fil
25 messages · Page 1 of 1 (latest)
so when they click to wishlist, add to cart, and checkout button, they will be redirected to this html file order form i made
It seems a bit extra to use a function to redirect the user.
Normally, you'd use an anchor tag
And let it handle redirecting you
You can easily find the answer just by googling
document.getElementbyId(button id).onclick(function());
then add the file path of my html file??
right
where?
my mates did something like this
does it work?
it worked for him, i think
not really sure, but i asked my instructor if i can use <a> tag
and he said we can use it
That's better
hi again, i tried doing this cause i want to explore more of my choices. and it worked, i guess
<script>
function getorderform(){
location.href = "C:/Users/jayne/kodegobootcamp/Josol, Jayne Ceilo Y._WD42P_Exercise2_Form.html"
}
</script>
i did this
i did some googling but i cant find what to write after. they use online links as an example so i was having some trouble finding what to use when you want to get the file locally
I am not sure what you need help with if it is already working
ah alright
I would assume the idea of using a function has to do with adding the cart/wishlist functionality