I need help on jquery/javascript -


OK, therefore, I have a question. I'm getting element id like this

 . & Lt; TD ID = "ctl00_cphRoblox_lstItemsForResale_ctrl1_Td1" class = "PriceBuyContainer" & gt;  

document.getElementById ("ctl00_cphRoblox_lstItemsForResale_ctrl1_Td1") and below it

  & lt ;. Div class = "Roblox- purchase-now btn-primary btn small PurchaseButton" data-item-id = "168167114" data-item-name = "wanwood visor" data-userasset-id = "1941846042" data-product-id = "20655974" data-expected-value = "114" data-asset-type = "hats" data-expected-currency = "1" data-expected-vendor-id = "6141596" data-BC-requirement = "0 "Data-vendor-name =" laugh blogs "& gt; Buy Now & lt; Span class = "btn-text" & gt; Buy Now & lt; / Span & gt; & Lt; / Div & gt;  

Will I get the data-expected-value = "NUMBERHERE" ?

  by document.getElementById ("ctl00_cphRoblox_lstItemsForResale_ctrl1_Td1"   

Use JQuery First, you can grab TD element via jQuery:

  above = $ ("# Ctl00_cphRoblox_lstItemsForResale_ctrl1_Td1 ");  

Then find and use this first child element: To return the value of expected value data attribute to the data ():

  Alert (el.find ('& gt; div'). Data ('expected value'));  

< / Html>

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -