javascript - Append messages different color in log_console -


can me javascript. have log console

<div id="log_console"></div> 

and need write function has 2 parameters type = {success, error} , text ="some text". need show each message in separated line , blue if success, red if error.

how solve problem ?

function log(type, text) {     var colour = (type = 'success') ? 'blue', 'red';     $('<p />').css('color', colour).html(text).appendto($('#log_console')); } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -