Gan ddefnyddio jQuery hoffwn:
Kudos i unrhyw un a all helpu!
$(document).ready(function(){
$('#countMe').keydown(function(event) {
// If number of lines is > X (specified by me) return false
// Count number of lines/update as user enters them turn red if over limit.
});
});
<form class="lineCount">
<textarea id="countMe" cols="30" rows="5"></textarea><br>
<input type="submit" value="Test Me">
</form>
<div class="theCount">Lines used = X (updates as lines entered)<div>
Ar gyfer yr enghraifft hon, gadewch i ni ddweud cyfyngu ar nifer y llinellau a ganiateir i 10.
Diolch i bawb!