Clicking a link

Hello, this should be simple, but I am pretty knew and having trouble finding an answer to this question. I am attempting to do a PETAL stack project and have used TailwindUI to give me an e-commerce template that is on a link called localhost4000/main. I then have another link called localhost4000/holly that I want to go to when I click the link Holly on my localhost4000/main page. The e-commerce localhost4000/main page or my main_live.html.leex page in my LiveView has a place where I have written Holly as a link and in an <a /a> tag I have put the href in for localhost4000/holly. So far this is what I have for my code in main_live.html.leex

β€˜β€™β€™



  • Holly


  • β€˜β€™β€™

    I’m wondering if I need to now handle the event in main_live.html?

    Any suggestions?

    Thanks!
    Kimberly

    Hi Kimberly,

    I noticed that the link that you posted has a β€˜#’ in it. <a href="#http://localhost:4000/holly"><br> Holly<br> </a>

    If you update to <a href="http://localhost:4000/holly"><br> Holly<br> </a> do you get the desired result?

    Also note, you don’t need the http://localhost:4000 part. Your link can just be <a href="/holly"><br> Holly<br> </a>

    4 Likes

    Oh those both do work! Thank you :slight_smile: