javascript - Change label on form label via JQuery -


i searched jquery change labels although there lot of answers didn't pertain question. want change label else includes links. can't seem work!! i've put js in head position of code had no luck , used jsfiddle please see below. doing wrong?

jsfiddle https://jsfiddle.net/14tx86j5/

html

    <input name="input_147.1" value="i agree veryappt’s terms of service" id="choice_3_147_1" type="checkbox">     <label for="choice_3_147_1" id="label_3_147_1">i agree companies terms of service</label> 

jquery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <script type="text/javascript">  jquery.noconflict();    jquery(document).ready(function($) {        $("#label_3_147_1 label").html('you agree our <a href="http://www.google.com/accounts/tos" name="terms" target="_blank">privacy policy</a>, describes how process information. <a href="https://support.google.com/accounts/answer/1733224?hl=en-gb" name="terms" target="_blank">learn more</a> why ask information.');     });  </script> 

you have wrong selector target label element. selector have used looks label element inside element id label_3_147_1. need use:

$("#label_3_147_1") 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -