Here is my HTML code:
<div class="list">
<input checked="checked" data-blacklist="[392,340,393]" data-parentarticleid="249" data-price="0" data-price-included="1" data-string-value="2x500GB SATA2" id="article_249" name="hardwareSetHD" type="radio" value="249"><label for="article_249">2x500GB SATA2 <span></span> </label>
</div>
<div class="list">
<input checked="checked" data-blacklist="[392,340,393]" data-parentarticleid="249" data-price="10" data-price-included="1" data-string-value="4x500GB SATA2" id="article_241" name="hardwareSetHD" type="radio" value="241"><label for="article_241">2x500GB SATA2 <span></span> </label>
</div>
<div class="list">
<input checked="checked" data-blacklist="[392,340,393]" data-parentarticleid="242" data-price="20" data-price-included="1" data-string-value="8x500GB SATA2" id="article_242" name="hardwareSetHD" type="radio" value="242"><label for="article_242">8x500GB SATA2 <span></span> </label>
</div>
What i want?
When the document is loaded to ADD in <span></span> after the input radio, the text holded in data-price.
Here is what i tried:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input[type=radio][name=hardwareSetRAM]').this(text($(this).attr( "data-price" )));
});
</script>
So how can i get the data-price from every input with name hardwareSetHD and add it as a text after the input ?
Thanks in advance!