0

I want to set title attribute whatever innerHTML text is there in a span. I know we can set css style based on the title attribute. But don't know how to set innerHTML as title using only CSS.

Eg. below is the span that I have.

<span id="spnData">A1234567890BCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123</span>

And below is what I want to achieve.

<span id="spnData" title="A1234567890BCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123">A1234567890BCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123</span>

Its dynamic control and I can not set it directly. I just want to know can we set innerHTML as title attribute using css only.

Note: I want to use pure CSS to do this and don't want to use any CSS plugin or JavaScript/Jquery. I know best choice here is Jquery but I want to know is it possible with CSS or not.

Thanks

Maharshi
  • 1,178
  • 1
  • 14
  • 37

1 Answers1

0

With pure CSS, it's currently impossible.

Awadhesh verma
  • 530
  • 4
  • 10