Reputation: 97
I have this code ->
var searchexampletxt = '<?php echo JText::_('SEARCH_EXAMPLE'); ?>';
Window.onDomReady(function(){
$('BLA_BLA').addEvent('focus',function(){
if(this.value=='<?php echo JText::_('SEARCH_EXAMPLE');?>')
{
this.value="";
}
});
$('BLA_BLA').addEvent('blur',function(){
if(this.value=='')
{
this.value="<?php echo JText::_('SEARCH_EXAMPLE');?>";
}
});
});
Can somebody help me please, how can I make the "SEARCH_EXAMPLE" text (that is by default shown in inputbox) be for example color #CCCCCC, but the text that I'm writing in the inputbox be for example #333333 ??
Thank you Cheers
Upvotes: 0
Views: 596
Reputation: 5769
Use this.style.color="red"
or using hex-code this.style.color="#FF0000"
.
So, for your example:
After this.value="";
add this.style.color="#CCCCCC";
After this.value="<?php echo JText::_('SEARCH_EXAMPLE');?>"
add this.style.color="#333333";
Upvotes: 2