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
Use
this.style.color="red"or using hex-codethis.style.color="#FF0000".So, for your example:
After
this.value="";addthis.style.color="#CCCCCC";After
this.value="<?php echo JText::_('SEARCH_EXAMPLE');?>"addthis.style.color="#333333";