user7027676
user7027676

Reputation:

How I can hide or change a url in anchor tag?

when i click on this link the url on page.php is http://localhost/1/page.php?id=1&edition=muzzaffarabad&dt=09-08-2017. i want that after passing these parameters only edition name will show on url .like http://localhost/1/muzzaffarabad

this is anchor tag i m using

<a class='imgFrame' href='page.php?id=1&edition=muzzaffarabad&dt=<?php echo $paper_set["muzzaffarabad_date"]?>'>

Upvotes: 0

Views: 433

Answers (1)

nick_green
nick_green

Reputation: 1664

Just make your a tag like this:

<a onclick="changeHref()" class='imgFrame' href='page.php?id=1&edition=muzzaffarabad&dt=<?php echo $paper_set["muzzaffarabad_date"]?>'>

Then in your javascript file add function

function changeHref() {
    $(".imgFrame").attr("href", "http://localhost/1/muzzaffarabad");
}

Upvotes: 1

Related Questions