ABA


"|עזרה |ב javascript בבקשה"
גירסת הדפסה        
קבוצות דיון בניית אתרים נושא #13480 מנהל    סגן המנהל    מפקח   Winner    צל"ש   מומחה  
אשכול מספר 13480
avir122

   22:44   23.01.08   
אל הפורום  
  |עזרה |ב javascript בבקשה  
 
   ערכתי לאחרונה בתאריך 23.01.08 בשעה 22:48 בברכה, avir122
 
שלום לכולם יש לי שאלה על פונקציה

אני רושצה לעשות שלושה button שעל כול אחד מהם רשום buttonוהמספר לדוגמא:

button1 button2 button3

וברגע שאני יעשה onclick על button1 אז button1 יחליף את 3 ו 2 יחליף את אחד ואז עוד הפעם ברגע שאני ילחץ על 2 אז הוא ילך אחורה ושלום התקדם .
ניסיתי כך

function abc(kk,ll,uu)
{
document.all.a3.value=kk;
document.all.a2.value=ll;
document.all.a1.value=uu;

}


<input type="button" id="a1" value="button1" onclick="abc('button1','button3','button2');">
<input type="button" id="a2" value="button1">
<input type="button" id="a3" value="button1">

עכשיו זה פועל לי רק בלחיצה הראשונה אבל בשניה זה לא פועל מה צריך לעשות שזה יפעל?


תודה רבה


                                שתף        
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד

  האשכול     מחבר     תאריך כתיבה     מספר  
  איך שאני מבין את מה שאתה מנסה לעשות code_blue  24.01.08 09:33 1

       
code_blue  לחץ כאן להצגת דירוג המשתמש
חבר מתאריך 5.7.06
21280 הודעות, 7 פידבק
   09:33   24.01.08   
אל הפורום  
  1. איך שאני מבין את מה שאתה מנסה לעשות  
בתגובה להודעה מספר 0
 
   הייתי מנסה עם innerHTML ואז בלחיצה אני כאילו כותב סדר חדש


function style(style)
{
var wh=document.getElemetntsById('div2');

var style1='
<input type="button" id="a1" value="button1" onclick="style('1')">
<input type="button" id="a2" value="button2" onclick="style('2')">
<input type="button" id="a3" value="button3" onclick="style('3')">

var style2='
<input type="button" id="a2" value="button2" onclick="style('2')">
<input type="button" id="a1" value="button1" onclick="style('1')">
<input type="button" id="a3" value="button3" onclick="style('3')">
';


style='
<input type="button" id="a3" value="button3" onclick="style('3')">
<input type="button" id="a1" value="button1" onclick="style('1')">
<input type="button" id="a2" value="button2" onclick="style('2')">
';



if (style==1)
wh.innerHTML=style1;
if (style==2)
wh.innerHTML=style2;
if style==3
wh.innerHTML=style3;
}

כמובן שצריך שיהיה לך איזה P או DIV שהוא עם ID שנקרא DIV2


                                                         (ניהול: מחק תגובה)
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד

תגובה מהירה  למכתב מספר: 
 
___________________________________________________________________

___________________________________________________________________
למנהלים:  נעל | תייק בארכיון | מחק | העבר לפורום אחר | מחק תגובות | עגן אשכול
       



© כל הזכויות שמורות ל-רוטר.נט בע"מ rotter.net