-6

I am trying to add a character d with the value of this.id given by below code as like : dclicki25 . How I can get this?

$('.divclasss').click(function(){

console.log(this.id); //clicki25 , clicki26 based on the clicking element

});
user3739733
  • 181
  • 1
  • 3
  • 14

2 Answers2

2

just Concatenatewith d like this

$('.divclasss').click(function(){

console.log('d'+ this.id); //clicki25 , clicki26 based on the clicking element

});
Sudharsan S
  • 15,336
  • 3
  • 31
  • 49
0

You can concatenate this.id with the string 'd' very easily with the below small change:

$('.divclasss').click(function(){
    console.log('d'+ this.id); //clicki25 , clicki26 based on the clicking element
});
Luke Peterson
  • 8,584
  • 8
  • 45
  • 46