JavaScript How can use a variable of Javascript in the “style” of tag? variable javascript style,javascript variable style guide,javascript variable css

i need create this function to improve my code. I need give to the a color given by the caller of the function, how can i do this?

Here the code:

function visualizza(array, div, color)
{
    div.html("");
    div.append("<p>");

    array.forEach(function (e)
    {
        div.append
        (
            "<span style='color: (here i need the variable)'>" + e.nominativo + "   Tel: "+e.cellulare+"</span><br>"
        )
    });

    div.append("</p>");
}
Answer:1

Use concatenation like the rest of your js variables

"<span style='color: "+color+"'>" + e.nominativo + "   Tel: "+e.cellulare+"</span><br>"
Answer:2

I'm trying to mimic the new Tumblr Text Post that removes blockquotes so all the important text is visible in a 250px text post without having to scroll. Of course Tumblr hasn't updated their entire ...

I'm trying to mimic the new Tumblr Text Post that removes blockquotes so all the important text is visible in a 250px text post without having to scroll. Of course Tumblr hasn't updated their entire ...

  1. remove specific html tags from string javascript
  2. remove specific html tags from string php
  3. remove specific html tags from string c#
  4. remove specific html tag using jquery
  5. remove specific html tag php
  6. remove specific html tags
  7. remove specific html tags from string
  8. remove specific html jquery
  9. remove specific html tags from string java
  10. remove specific html tags from string jquery
  11. remove specific html tags using php
  12. python remove specific html tags
  13. regex remove specific html tags
  14. sed remove specific html tag
  15. jsoup remove specific html tags
  16. regex remove specific html tags javascript
  17. jquery remove specific html tags
  18. javascript remove specific html tags
  19. regex remove specific html tags c#
  20. remove specific div html

I've searched for solutions on Google and SO but still cannot find an answer. They all stop at "Add item to cart" or "increase/decrease quantity" but never on calculating the Total, which is annoying! ...

I've searched for solutions on Google and SO but still cannot find an answer. They all stop at "Add item to cart" or "increase/decrease quantity" but never on calculating the Total, which is annoying! ...

  1. react redux calculator
  2. react redux calculator example
  3. react redux calculator app
  4. react redux calculator codepen
  5. calculator using react redux
  6. calculator app using react redux
  7. react native redux calculator

Here's my full code: $('input').keypress(function(e){ var code = e.keyCode || e.which, value = $(this).val() if (code==13 && value!=''){ $('.with-header').show() ...

Here's my full code: $('input').keypress(function(e){ var code = e.keyCode || e.which, value = $(this).val() if (code==13 && value!=''){ $('.with-header').show() ...

  1. remove autofocus html
  2. remove input autofocus
  3. remove autofocus input html

How can I show SweetAlert in this JavaScript code? function removeReg(del_reg) { if (confirm("Are you sure you want to delete? \n the reg name : " + del_reg)) { // Code goes here } } I just ...

How can I show SweetAlert in this JavaScript code? function removeReg(del_reg) { if (confirm("Are you sure you want to delete? \n the reg name : " + del_reg)) { // Code goes here } } I just ...