I'd recommend putting the text inside a <label>
tag so that you could click on it (and so that screen readers and such could make sense of your form):
<input type="checkbox" name="PrePayment" id="pre-payment">
<label for="pre-payment">Pre-Payment</label>
<br />
Then, the whole thing becomes easy:
var text = $('label[for=pre-payment]').text();
var or_this = $('#pre-payment').next('label').text();
I'd prefer the first option, label[for=...]
, as it is less fragile than the second
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…