how to read character behind some text
- by klox
this one a code for read two character behind text "KD-R411ED"
var code = data[0].substr(data[0].length - 2);
how to read ED character if text like KD-R411H2EDT? i want a new code can combine with code above..please help!!
look this:
$("#tags1").change(function() {
var barcode;
barCode=$("#tags1").val();
var data=barCode.split(" ");
$("#tags1").val(data[0]);
$("#tags2").val(data[1]);
var code = data[0].substr(data[0].length - 2); // suggested by Jan Willem B
if (code == 'UD') {
$('#check1').attr('checked','checked');
} else {
if (code == 'ED') {
$('#check2').attr('checked','checked');
}
}