We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Re: How to delete a Title html attribute so that it doesn't appear as a tooltip upon hover?

Solved

How to delete a Title html attribute so that it doesn't appear as a tooltip upon hover?

Tarek_K
New Member
4 0 0

I am using the Prestige theme and I want to add a video hero section (autoplay muted with no button controls) with a Shop Now button in the middle. However, I noticed that the default Prestige video section doesn't come with a Button block, just Subheading, Heading and Paragraph. I inserted a link for the text through the text editor and added some custom css to make it look like a button. However, there is still one problem. The Title attribute in the <a> anchor tag is showing as a tooltip when I hover over the link which as you can imagine doesn't look good considering I am trying to make it look like a button.

I don't have experience in Shopify's liquid code, so I was wondering if there is a way to edit the code to remove the Title attribute from this link only? I don't want to remove the Title attribute from other element on the website, just this specific anchor tag. If there is an easier way to add a button without doing all this, I am open to suggestions. Thanks.

Tarek_K_0-1695303663070.png

 

Accepted Solution (1)
Asad24
Shopify Partner
180 36 33

This is an accepted solution.

Yes, you can remove the title using the javascript

var linkElement = document.querySelector('a[title="best-dog-ever-dog-bandana-collar"]');
 if (linkElement) {
 linkElement.removeAttribute('title');
}

banned

View solution in original post

Replies 5 (5)

Asad24
Shopify Partner
180 36 33

Could you please share your store so i can check

banned
Tarek_K
New Member
4 0 0

I am still in the trial period for Prestige theme, so I still can't access the code. I am just looking for ideas to solve this issue before purchasing the theme. Below are some screenshots of the situation now. Hope this helps.

Tarek_K_0-1695309942260.pngTarek_K_1-1695309975040.png

Tarek_K_2-1695310038301.png

 

Asad24
Shopify Partner
180 36 33

This is an accepted solution.

Yes, you can remove the title using the javascript

var linkElement = document.querySelector('a[title="best-dog-ever-dog-bandana-collar"]');
 if (linkElement) {
 linkElement.removeAttribute('title');
}

banned
Tarek_K
New Member
4 0 0

@Asad24 Thanks a lot!

Asad24
Shopify Partner
180 36 33

You are welcome

banned