PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, February 28, 2022

[FIXED] I want to navigate to a div using a button HTML

 February 28, 2022     html, navigation, php     No comments   

Issue

I am using this code for button:

 <input type="button"
        style="margin-left:350px"
        id="replybottom"
        name="replybottom"
        onClick="#navigateHere"
        class="button"
        value="Reply"></div>

this is my div:

<div id="navigateHere"
     name="navigateHere"
     class="convomsg12">

Solution

onClick="#navigateHere" This is Wrong way to Navigate.

Instead of that use this code.

   function goto(url)
    {
    window.location=url;

    }

Here your Button

<div onclick="goto('#navigateHere')">Replay</div>

If you want to give button you can give like this

<input type="button"  onclick="goto('#navigateHere')"  value="Replay"/>


Answered By - Dinesh Kanivu
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing