首页 > 解决方案 > Get Text in Span Using CSS Selector

问题描述

I'm using a product called Stonly to place tool tips. In there, we are to use the CSS Selector to find the HTML element to identify the tool tip. Now, when I do this for some of our elements on the page, the path isn't what I always want. Instead, I want to identify the element to place a tool tip based on the text in the span. How would I do that?

Below is the CSS Selector output

#root > div:nth-child(3) > div > div.container > div > div.w70.w-990-100 > div:nth-child(3) > div > form > h4 > span

Below is the snippent of HTML

<div className="comm-section">
            <form autoComplete="off">
                <h4 className="commHdn"><span> Type of Property {data?.type_of_property_id} </span></h4>
                {/* 17Dec */}
                <div className="f-row f-3 f-576-2">
                    {/* start */}

标签: htmlcss

解决方案


推荐阅读