0
Is there any way in Javascript or jQuery to include a Id
in a div
within a condition?
In my code I will exemplify:
$('#TxtDesc').on('input', function(){
var value = $(this).val();
var progressValue = $('#progressText div');
var color, percent = 0;
if(value.length <= 100){
color = "red";
percent = 15;
}else if(value.length <= 199){
color = "yellow";
percent = 50;
}else{
color = "#32CD32";
percent = 100;
/* Gostaria que nessa condição fosse adicionado um id
para a div onde o script roda */
}
var Valor = value.length;
progress(percent, $('#progressText'), 300);
progressValue.css("background", color);
$('#progressText').css("border", "1px solid " + color);
});
Is there any way this can be done?
Dude, that’s right, but I wanted this, so that another function could find this information, but when changing the id, it doesn’t count this new id
– Jorge