Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get Value From Attribute in JQuery

I have this attribute element and I want to extract the value from it.
I’m not sure how will I do it?
I want to extract value from

<select name="Hello/1.0/TestWorld" size="1" disabled="disabled" data-original-title="" title="">
  <option value=""></option>
  <option value="Hello">Hello</option>
 </select>

<script>
$(document).ready(function(){
  const hello = $('qualifier="Hello/1.0/TestWorld"')

  console.log('HELLO', hello)
    });
</script>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

$(document).ready(function(){
  const elem = jQuery('[name="Hello/1.0/TestWorld"]');

  console.log(`HELLO: "${elem.val()}"`)
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

<select name="Hello/1.0/TestWorld" size="1" disabled="disabled" data-original-title="" title="">
  <option value=""></option>
  <option value="Hello">Hello</option>
 </select>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading