Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    Jquery get values for P tag using id

    AI Programming
    jquery
    2
    3
    340
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rashmiee
      rashmiee last edited by

      table ekak thiyenawa.. eke eka row ekaka p tag dekak thiyenawa.. eke eka p tag ekaka value eka ganna one using p tag id.

      <tr>
      <td class="pro-thumbnail"><a href="#"><img src="assets/images/products/product01.jpg" class="img-fluid" alt="Product"></a></td>
      <td class="pro-title"><a href="#">Cillum dolore tortor nisl fermentum</a></td>
      <td class="pro-price"><span><p id="ProductPrize">28.00</p></span></td>
      <td class="pro-quantity"><div class="pro-qty"><input type="text" value="1"></div></td>
      <td class="pro-subtotal"><span><p id="totPrize">28.0</p></span></td>
      <td class="pro-remove"><a href="#"><i class="fa fa-trash-o"></i></a></td>
      </tr>

      id="ProductPrize" eke thiyena value eka jquery walin multiply karala id="totPrize" mekata assign karanna one

      1 Reply Last reply Reply Quote 0
      • b6
        b6 last edited by b6

        You cannot access multiple DOM element using same id. Because Id is unique for each element in entire DOM. So you can't use id ProductPrize in more than 1 row.

        I recommend you to use data attribute or hidden input fields or javascript array of object.

        1 Reply Last reply Reply Quote 1
        • rashmiee
          rashmiee last edited by

          Ohh Thank you!! i'll do that way..

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post

          0
          Online

          3.6k
          Users

          1.3k
          Topics

          5.3k
          Posts

          • Privacy
          • Terms & Conditions
          • Donate

          © Copyrights and All right reserved Lanka Developers Community

          Powered by Axis Technologies (PVT) Ltd

          Made with in Sri Lanka

          | |