Form text in $ ('span.text'). text ();

0

I would like to format text in the following line:

$('span.texto').text('Enviamos um email para email@email');

I would like you to stay:

We send an email to email @ email

I tried

$('span.texto').text('Enviamos um email para <b>email@email</b');

But did not give yet

    
asked by anonymous 18.05.2017 / 23:45

1 answer

1

Change text to html :

$('span.texto').html('Enviamos um email para <b>email@email</b');
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><spanclass="texto"></span>
    
18.05.2017 / 23:47