Wrap link around
Is it possible to wrap an <a> tag around <div>s like so: <a href=etc etc> <div class=”layout”> <div class=”title”> Video Type <div class=”description”>Video description</div> </div> </div> </a> Eclipse is telling me the div’s are in the wrong place? If this is not allowed. How can I make the entire ‘layout’ class become a link? Answer … Read more
Set visited link color to whatever the color of un-visited link is (P.S. not the usual question)
I need to set the a:visited CSS to whatever color the normal a is set to. What I want to be able to tell the browser is, for the visited links, use the same color as the unvisited links, whatever color it is. I need to do this without specifying a particular color. Like, if … Read more
How do I combine an anchor tag AND a passed variable in an HTML HREF?
Say I have an anchor somewhere on a different page: <A NAME=”blah”> On the page I’m currently on, I want to go that that anchor on that different page while also passing a GET parameter, such as, for example: <A HREF=”otherpage.htm#blah?data=1234″>Good Stuff!</A> This doesn’t seem to be working for me. It loads the page and … Read more
Using jQuery to programmatically click an link
I know this question has been asked before, but after a search on the web I can’t seem to find a straight forward answer. the HTML <a id=myAnchor href=index.php> the jQuery (Both of these do not work) $(‘#myAnchor’).click(); or $(‘#myAnchor’).trigger(‘click’); What is the simplest and most efficient way to achieve this? Answer Try this: $(‘#myAnchor’)[0].click(); … Read more
What is meant by the rel=”bookmark” link attribute?
What is the purpose of the rel=”bookmark” attribute in <a> tags? For example: <a href=”http://stackoverflow.com/questions/ask” rel=”bookmark”>Click Here</a> Does it serve any SEO- or SEM-related purpose? Answer This has no SEO value or purpose. I believe the rel=bookmark tag was intended to mark permalinks but it never really gained traction AttributionSource : Link , Question Author … Read more
How to get “raw” href contents in JavaScript
I am trying to write a GreaseMonkey script in which I want to find all of the links that are relative links. It seemed to me that the way to do that would be to match the contents of href against /^https?:///. But I find that when I access the anchor’s href attribute, it’s always … Read more
How can I create an empty HTML anchor so the page doesn’t “jump up” when I click it?
I’m working on some JQuery to hide/show some content when I click a link. I can create something like: <a href=”#” onclick=”jquery_stuff” /> But if I click that link while I’m scrolled down on a page, it will jump back up to the top of the page. If I do something like: <a href=”” onclick=”jquery_stuff” … Read more
href=”#” Going to Top of Page – Prevent? [duplicate]
This question already has answers here: How to prevent a click on a ‘#’ link from jumping to top of page? (24 answers) Closed 4 years ago. I have a page with some jQuery functions. The HTML on the page looks like so: <a href=”#” class=”service”>Open</a> When I click the Open button a hidden panel … Read more
How to test anchor’s href with react-testing-library
I am trying to test my anchor tag. Once I click it, I want to see if the window.location.href is what I expect. I’ve tried to render the anchor, click it, and then test window.location.href: test(‘should navigate to … when link is clicked’, () => { const { getByText } = render(<a href=”https://test.com”>Click Me</a>); const … Read more
React site warning: The href attribute requires a valid address. Provide a valid, navigable address as the href value jsx-a11y/anchor-is-valid
I am getting a warning on a React site I built ./src/components/layout/Navbar.js [1] Line 31: The href attribute requires a valid address. Provide a valid, navigable address as the href value jsx-a11y/anchor-is-valid on the following code: <p> {isEmpty(profile.website) ? null : ( <a className=”text-white p-2″ href={profile.website} target=”#” > <i className=”fas fa-globe fa-2x” /> </a> )} … Read more
Is it possible to wrap an <a> tag around <div>s like so: <a href=etc etc> <div class=”layout”> <div class=”title”> Video Type <div class=”description”>Video description</div> </div> </div> </a> Eclipse is telling me the div’s are in the wrong place? If this is not allowed. How can I make the entire ‘layout’ class become a link? Answer … Read more
Set visited link color to whatever the color of un-visited link is (P.S. not the usual question)
I need to set the a:visited CSS to whatever color the normal a is set to. What I want to be able to tell the browser is, for the visited links, use the same color as the unvisited links, whatever color it is. I need to do this without specifying a particular color. Like, if … Read more
How do I combine an anchor tag AND a passed variable in an HTML HREF?
Say I have an anchor somewhere on a different page: <A NAME=”blah”> On the page I’m currently on, I want to go that that anchor on that different page while also passing a GET parameter, such as, for example: <A HREF=”otherpage.htm#blah?data=1234″>Good Stuff!</A> This doesn’t seem to be working for me. It loads the page and … Read more
Using jQuery to programmatically click an link
I know this question has been asked before, but after a search on the web I can’t seem to find a straight forward answer. the HTML <a id=myAnchor href=index.php> the jQuery (Both of these do not work) $(‘#myAnchor’).click(); or $(‘#myAnchor’).trigger(‘click’); What is the simplest and most efficient way to achieve this? Answer Try this: $(‘#myAnchor’)[0].click(); … Read more
What is meant by the rel=”bookmark” link attribute?
What is the purpose of the rel=”bookmark” attribute in <a> tags? For example: <a href=”http://stackoverflow.com/questions/ask” rel=”bookmark”>Click Here</a> Does it serve any SEO- or SEM-related purpose? Answer This has no SEO value or purpose. I believe the rel=bookmark tag was intended to mark permalinks but it never really gained traction AttributionSource : Link , Question Author … Read more
How to get “raw” href contents in JavaScript
I am trying to write a GreaseMonkey script in which I want to find all of the links that are relative links. It seemed to me that the way to do that would be to match the contents of href against /^https?:///. But I find that when I access the anchor’s href attribute, it’s always … Read more
How can I create an empty HTML anchor so the page doesn’t “jump up” when I click it?
I’m working on some JQuery to hide/show some content when I click a link. I can create something like: <a href=”#” onclick=”jquery_stuff” /> But if I click that link while I’m scrolled down on a page, it will jump back up to the top of the page. If I do something like: <a href=”” onclick=”jquery_stuff” … Read more
href=”#” Going to Top of Page – Prevent? [duplicate]
This question already has answers here: How to prevent a click on a ‘#’ link from jumping to top of page? (24 answers) Closed 4 years ago. I have a page with some jQuery functions. The HTML on the page looks like so: <a href=”#” class=”service”>Open</a> When I click the Open button a hidden panel … Read more
How to test anchor’s href with react-testing-library
I am trying to test my anchor tag. Once I click it, I want to see if the window.location.href is what I expect. I’ve tried to render the anchor, click it, and then test window.location.href: test(‘should navigate to … when link is clicked’, () => { const { getByText } = render(<a href=”https://test.com”>Click Me</a>); const … Read more
React site warning: The href attribute requires a valid address. Provide a valid, navigable address as the href value jsx-a11y/anchor-is-valid
I am getting a warning on a React site I built ./src/components/layout/Navbar.js [1] Line 31: The href attribute requires a valid address. Provide a valid, navigable address as the href value jsx-a11y/anchor-is-valid on the following code: <p> {isEmpty(profile.website) ? null : ( <a className=”text-white p-2″ href={profile.website} target=”#” > <i className=”fas fa-globe fa-2x” /> </a> )} … Read more