NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

TRIS (in corso da cambiare con il primo rigo del notes)

HTML

<html>
<body>
<h1>
Prova di un tris con tabella
</h1>
X = tu <br>
O = computer <br><br>
<ol>
<li> Clicca un pulsante per far comparire la X nella tabella : </li> <br>
<button onclick="sceltaUt(1)">
In alto a sx
</button>
<button onclick="sceltaUt(2)">
In alto
</button>
<button onclick="sceltaUt(3)">
In alto a dx
</button><br><br>
<button onclick="sceltaUt(4)">
In mezzo a sx
</button>
<button onclick="sceltaUt(5)">
In mezzo
</button>
<button onclick="sceltaUt(6)">
In mezzo a dx
</button><br><br>
<button onclick="sceltaUt(7)">
In basso a sx
</button>
<button onclick="sceltaUt(8)">
In basso
</button>
<button onclick="sceltaUt(9)">
In basso a dx
</button><br><br>
<li>
Ora clicca sul bottone per far comparire la scelta del computer nella tabella :
</li>
<br>
<button onclick="sceltaPc()">
COMPUTER
<br>
</button>
<br><br>
<li>
E poi ricomincia da sopra
</li>
</ol>
<br><br>
<table>
<tr>
<td id="id1">
</td>
<td id="id2">
</td>
<td id="id3">
</td>
</tr>
<tr>
<td id="id4">
</td>
<td id="id5">
</td>
<td id="id6">
</td>
</tr>
<tr>
<td id="id7">
</td>
<td id="id8">
</td>
<td id="id9">
</td>
</tr>
</table>
<p id=risul> </p>
</body>
</html>

---

CSS

table,td {
border:solid 2px;
border-collapse:collapse;
}
td {
width:60px;
height:70px;
text-align:center;
}

---

JAVASCRIPT

var click1 = 0
var click2 = 0

var num1 = 0
var num2 = 0
var num3 = 0
var num4 = 0
var num5 = 0
var num6 = 0
var num7 = 0
var num8 = 0
var num9 = 0

function sceltaUt (a) {
if (a==1) {
document.getElementById("id1").innerHTML = "X";
num1++
}
else if (a==2) {
document.getElementById("id2").innerHTML = "X";
num2++
}
else if (a==3) {
document.getElementById("id3").innerHTML = "X";
num3++
}
else if (a==4) {
document.getElementById("id4").innerHTML = "X";
num4++
}
else if (a==5) {
document.getElementById("id5").innerHTML = "X";
num5++
}
else if (a==6) {
document.getElementById("id6").innerHTML = "X";
num6++
}
else if (a==7) {
document.getElementById("id7").innerHTML = "X";
num7++
}
else if (a==8) {
document.getElementById("id8").innerHTML = "X";
num8++
}
else if (a==9) {
document.getElementById("id9").innerHTML = "X";
num9++
}
}
function sceltaPc () {
if (num5 ==0) {
document.getElementById("id5").innerHTML = "O";
click1++
}
if (num5==1) {
document.getElementById("id7").innerHTML = "O";
click2++
}
if (num1==1 && num2==1) {
document.getElementById("id3").innerHTML = "O";
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.