skip to Main Content

Get span text Jquery

I am trying to retrieve a span text -cnn.com from the below structure using jquery. var txt = $(".example1 >.myNewTest").closest('.subexample2').find('span').text(); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="example1" id="test1"> <div id="wkTest" class="myNewTest"> <h2 class="subexample2"> <span class="moreTest></span> <span>cnn.com</span>---->I need this. <span>/</span> <span>News</span> </h2> </div> </div>

VIEW QUESTION

Hide or Manipulate URL in browser left-bottom side when mouse curser placed in ahref tag – Jquery

I want to hide, remove or manipulate URL display in left-bottom in browser like Google. Trying with JS: <a href="https://example.com" onmouseover="window.status='google.com'; return true;" onmouseout="window.status=''; return true;">Example</a> Trying with CSS : .no-tooltip:hover::after { content: none !important; } <a href="http://example.com" class="no-tooltip">Link</a> Google…

VIEW QUESTION

Splitting a Pipe delimited text and passing it in a JS method – Jquery

Html - <div class="pageEdit" value="Create|8765678|FOOD=6578~-8765678?|9381"> <a href="https://host:controller">Edit</a> </div> I want to get the value inside the div and pass that in a Javascript method after splitting pipe. $(".pageEdit").on('click',function(event){ var data = $(".pageEdit").text().split("|"); functionPageCreate(data(0),data(1),data(2),data(3)); }); This is not working. I do…

VIEW QUESTION

Jquery text() method and a conditional statement can't specify an empty string

myTags.html <div id="ControlWrapper"> <p>​</p> <p><br></p> <p>​​</p> </div> myScripts.js var a = $("#ControlWrapper").text(); if (a == ""){do something;}else {do something else;} <div id="ctl00_PlaceHolderMain_txtContent__ControlWrapper_RichHtmlField" class="ms-rtestate-field" style="display: block;" aria-labelledby="ctl00_PlaceHolderMain_txtContent_label"> <p>​</p> <p><br></p> <p>​​</p> </div> Hi, i have the above codes in my html and…

VIEW QUESTION
Back To Top
Search