Jump to content

shaijuelayidath

Members
  • Posts

    35
  • Joined

  • Last visited

shaijuelayidath's Achievements

Newbie

Newbie (1/7)

3

Reputation

  1. Hello Experts, i would like to know the logic behind the following forloop. for(i=0;i<5;i++){ document.write(i+6); // i can't understand whats the logic working here } the result is: 678910 Actually i was looking for a forloop which is starting from any number and repeating with a condition at certain time. I found the above forloop is doing exact function as i expect. But i can't understand the logic and functional structure happening there. As per my understanding it should not work as the condition mentioend in the parenthesis is "i<5" but i added i in the statement as "i+6" which is greater than 5, so it should get error. But i wonder why it works. And also i am confused on the interrelation between the i of the body of forloop and i inside the parenthesis (). Can anyone explain it in simple theory because i hope understanding this logic is important in further stage of my work. Thanks in advance!
  2. Hello dsonesuk, Thanks for your explanation, I understood it. But my question is not concerned about 'Mobile First' or 'Desktop First' approach. If you using 'Dreamweaver' can you check the following steps. 1. Write the following code in your CSS files which linked to the HTML @media screen and (max-width: 768px) { .box {display:none} } 2. Come in to HTML file then type the following code: <div class=" when you type upto the above code, an automatic suggestion box will come and it shows the class 'box' you have already defined in the CSS file using " max-width ". 3. Now change the the same code into 'min-width' as follows: @media screen and (min-width: 768px) { .box {display:none} } 4. Then type the following code : <div class=" Now automatic suggestion box is not showing the class 'box'. Conclusion of my question is: CSS classes defined in 'max-width' will show in the automatic suggestion box in dreamweaver, But 'min-width' is not. I hope you understood Thanks in Advance Shaiju
  3. Hello dsonesuk, Sorry I did'nt understand your comment. Can you please explain. Thanks! Shaiju
  4. Hello Friends, I have the following CSS class 'box' defined with 'min-width' media query. @media screen and (min-width: 768px) { .box {display:none} } But this class is not showing in dreamweaver class suggestions. But when I put the same class using 'max-width', then suggestion is showing as per the following screenshot. Anyone know whats the reason and how to resolve this. Thanks in advance. Thanks! Shaiju.
  5. Hello Igolme, Its nice article which is a new thread for my doubt....Thank you
  6. Hello Ingolme, Tezzo, musakilimanjaro, Basically I need a two column layout for content section. Please take a look at my following 2 HTML codes. Let me know No.1 or No.2 is right ? ---------------------------------------------------------------------------------------------------- No.1 ---------------------------------------------------------------------------------------------------- <main> <section> <-- main content goes here --> <aside> <--- subcontent goes here --> </main> ---------------------------------------------------------------------------------------------------- No.2 ---------------------------------------------------------------------------------------------------- <section> <main> <--- main content goes here --> <aside> <--- subcontent goes hee --> </section> ---------------------------------------------------------------------------------------------------- let me know which one can be use. Because nowhere is discussed about <aside> tag can be put inside of <main> tag. Thanks!
  7. Hello Tezzo, Actually can I put 'section' and 'aside' tag inside of a 'main' tag. Because some are says 'main' tag is only for main content of the webpage and 'aside' tag is for secondary contents. So, 'main' and 'aside' tags are separate blocks which comes in a section or div. The links you have send is good but did you listen, there is no clearly says what elements can be contain by the 'main' tag. I searched few but nowhere is discussing about this term. Thanks!
  8. Hello Friends, Recently i have read about 'main' tag is introduced in HTML5, but i could'nt found anywhere explained about the proper use of this tag. Means, everywhere explaining it is for main content of the website, but I would like to know that can we put 'section' and 'aside' tag within the 'main' tag. This is only i want to know. Thanks in advance!
  9. When we make a Dropdown Select box, the width of the option is automatically expands as per it's content or strig's width in almost browsers.But in IE7 (WinXP) it is getting cut off and showing only the portion as per its select bar's width. Is there any trick by Javascript/JQuery/CSS to show complete content in the option in IE7. When you test the following code you can understand it. Kindly help me in this case. <select> <option selected="selected">select</option> <option>Very long and extensively descriptive text</option></select>
  10. sorry still i did'nt get what the role of 'x', because i'm very new to javascript
  11. In the For Loop tutorial of w3si did'nt understand some code line of the following js code, i indicated it below ------------------------------------------------------------------------------------------------------------------------<button onclick="myFunction()">Try it</button><p id="demo"></p> <script>function myFunction(){var x="",i; <---[ what this type of var means, and wat this "" means, ]for (i=0;i<5;i++) { x=x + "The number is " + i + "<br>"; <---[ What the x=x means] }document.getElementById("demo").innerHTML=x;}</script>------------------------------------------------------------------------------------------------------------------------Actually i tried and found it can be write another method, but why w3s written the above indicated method, and not mentioned anywhere about this kind of for loop method.
  12. something wrong again i faced, the code i done is below: <script>function myFunction(){var x;var name=prompt("Please enter your name","Harry Potter"); if (name!=null){x="Hello " + name + "! How are you today?";document.getElementById("demo").innerHTML=x;}else (name==null){x="Hello Stranger ! How are you today?";document.getElementById("demo").innerHTML=x;}}</script> if i click again in the button and enter a different name, it is showing only 'Hello Stranger !How are you today?"can it possible 'when i am entering a 'name', it should be show 'name' and when i make it empty it should show 'Hello Stranger How are you today?"
  13. <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script>function myFunction(){var x;var name=prompt("Please enter your name","Harry Potter"); if (name!=null) { x="Hello " + name + "! How are you today?"; document.getElementById("demo").innerHTML=x; }}</script> i am new to javascript and refering w3schools.when execute the above codeif i am enter any name is the prompt box, it is coming correctly.eg. if I give a name 'Tom' in the prompt box, it will get' Hello Tom ! How are you today? 'But if i did'nt type any thing, or if i make it is empty, i am getting' Hello ! How are you today? 'Can i bring a word 'Stranger' in between 'Hello" and "How are you today?"if the promptbox made empty:eg.' Hello Stranger How are you today?'
  14. In the if else tutorial, when I used a condition (10>5) it is working, but when i placed a name (string) it is not working. Code given below <script type="text/javascript">if(x="Johny"){a="Welcome Johny";}else{a="Welcome New User";}document.getElementById("on").innerHTML=a;</script> If i make any change in the name "Johny", it should'nt be show "Welcome New User" ?
×
×
  • Create New...