
المشاركة الأصلية كتبت بواسطة mahmoud009
كود HTML:
<input type="text" style="background-color:#000000;" onfocus="this.style.cssText='background-color:#FFFFFF;'" onfocusout="this.style.cssText='background-color:#000000;'">
تفضل أخي
ماشاء أضفت الى قاموسي الإسم (cssText) أنا عوض
كود PHP:
this.style.cssText='background-color:#000000;'
أصل الى نفس الغرض عن طريق
كود PHP:
this.style.backgroundColor='#000000'
لكن عند دالة غير قياسية و هي onfocusout حيث انها تشتغل في متصفح IE
لذا إستبدلها بـ onblur
أخي haidar اذا كنت تريد تغيير لون الخلفية فقط فكود الاخ mahmoud009 كافي وشافي غير فقط
onfocusout الى onblur
او كودي
كود PHP:
<input type="text"
style="background-color:#ff0000"
onfocus="this.style.backgroundColor='#FFFFFF'"
onblur="this.style.backgroundColor='#ff0000'"
/>
اما إذا اردت تغيير صورة الخلفية فإليك هذا
كود PHP:
<input type="text"
style="background-image:url(http://www.swalif.net/softs/images/buttons/reply.gif)"
onfocus="this.style.backgroundImage='url(http://www.swalif.net/softs/images/buttons/newthread.gif)'"
onblur="this.style.backgroundImage='url(http://www.swalif.net/softs/images/buttons/reply.gif)'"
/>