<a href=“#third”> <button> Go to third section </button> </a>
….
<a name=“third”>
<div>
….
document.getElementById("1").style.visibility =‘visible’
:cookie: 346 | @pkshreeman |http://www.freecodecamp.com/pkshreeman
j1417 sends brownie points to @pkshreeman :sparkles: :thumbsup: :sparkles:
<button id=“firstbutton” class =“crazybuttons” > Press me! </button>
document.getElementById(“firstbutton").style.visibility =‘visible’
.crazybuttons {
visibility: hidden
}
:warning: j1417 already gave pkshreeman points
j1417 sends brownie points to @pkshreeman :sparkles: :thumbsup: :sparkles:
:cookie: 442 | @walidashri |http://www.freecodecamp.com/walidashri
logans1 sends brownie points to @walidashri :sparkles: :thumbsup: :sparkles:
joyinthenow sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1820 | @khaduch |http://www.freecodecamp.com/khaduch
span {
display: inline-block;
}
and everything else will work
ricky11 sends brownie points to @rationalcoding :sparkles: :thumbsup: :sparkles:
:cookie: 276 | @rationalcoding |http://www.freecodecamp.com/rationalcoding
kodin24 sends brownie points to @coffeebeanzz :sparkles: :thumbsup: :sparkles:
:star2: 1212 | @coffeebeanzz |http://www.freecodecamp.com/coffeebeanzz
var array = ['','','','','''];
:bulb: to format code use backticks! ``` more info
silver537 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 782 | @sorinr |http://www.freecodecamp.com/sorinr
<meta>
for responsiveness? <meta name="viewport" content="width=device-width, initial-scale=1">
<form class="navbar-form navbar-right">
@NitinNair89 just a sec to find your pen link
@sorinr codepen.io/Nitin-Chandran-Nair/full/rLpORj
<div class="row">
<p>test</p>
</div>
@gastikirs
<i id="contact-snapchat" class="icon-contact fa fa-snapchat fa-4x" aria-hidden="true"></i></a>
</div>
<p> why</p>
</div>
this one did
ndzhingarova sends brownie points to @nitinnair89 :sparkles: :thumbsup: :sparkles:
:cookie: 299 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
function dropElements(arr, func) {
// Drop them elements.
var tempArray = arr.filter(func);
var arrIndex = arr.indexOf(tempArray[0]);
return arr.slice(arrIndex);
}
dropElements([1, 2, 3, 4], function(n) {return n > 5;});
https://www.freecodecamp.com/challenges/drop-it
silver537 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:warning: silver537 already gave sorinr points
@silver537 if you comment / left: 20px; / its still working the right way
in CSS comments are/* ... */
italics
in markdown language.
I am making tic tac toe game as FCC project,I am having a problem that is whenever the human player plays his move the computer should iterate through the array and find the empty location and play a move their but it is not doing so here is my logic can anyone tell me where am i doing that wrong:
if (value[0]=='X' || value[0]=='O')
{
return;
}
else{
for(var i=0;i<value.length;i++)
{
if (value[i] == ' ')
$(value[i]).html(computer_sign);
}
$("#b1").html(sign_option);
value[0].push($("#b1").html(sign_option));
}
});
A small code snippet.
@sorinr @silver537
silver537 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 783 | @sorinr |http://www.freecodecamp.com/sorinr
arr[0].push($("#b1").html(sign_option));
sign_option
arr.push(); //arr is the array name
${}
?
for(var i=0; i<10; i++) {
arr.push("");
}
if (player_option == '1'){
$("#b1").on("click",function(){
if (arr[0]=='X' || arr[0]=='O')
{
}
else{
for(var i=0;i<arr.length;i++)
{
if (arr[i] =="")
$("#b" + arr[i]).text(computer_sign);
}
$("#b1").html(sign_option);
arr.splice(0,0,sign_option);
}
});
@MohammadHasham arr is empty
text-align:justify;
c0d0er sends brownie points to @gofighting123 :sparkles: :thumbsup: :sparkles:
:cookie: 308 | @gofighting123 |http://www.freecodecamp.com/gofighting123
for(var i=0;i<arr.length;i++)
{
if (arr[i] =="")
$("#b" + arr[i]).html(computer_sign);
}
arr.splice(0,0,sign_option);
for(var i=0; i<9; i++) {
arr.push("");
}
not i<10
$("#b1").on("click",function(){...}) means
var b1 = document.getElementById('b1');
b1.addEventListener('click', function(){..});
the function will not be executed only if you click, and when it is executed it checks you first if statement, which will be always true
if (arr[0]=='X' || arr[0]=='O')
just if(arr[0...8] !== "") its enough
$('#id).hide();
u mean like this:
<form class="text-center" action= href"https://www.youtube.com/watch?v=S0kX1JeecSQ"><input class="b1 button2"type="submit" value="Click here if you dear.."></form> ?
if so i did not work
target="_blank"
in your anchor tags it will open your link on a different tab… if that’s what you mean by external page
:warning: could not find receiver for cd
tomididak sends brownie points to @cd :sparkles: :thumbsup: :sparkles:
tomididak sends brownie points to @magnus195 :sparkles: :thumbsup: :sparkles:
:cookie: 119 | @magnus195 |http://www.freecodecamp.com/magnus195
target="_blank"
so it opens in another tab
kenz9932 sends brownie points to @thebenjimoto :sparkles: :thumbsup: :sparkles:
:cookie: 259 | @thebenjimoto |http://www.freecodecamp.com/thebenjimoto
So I'm trying to get it so that i can call an <audio> element to play multiple times. right now I have the code ```function playAud(aud) {
aud.play();
aud.onended = function() {
aud.pause();
};
}```
function playAud(aud) {
aud.play();
aud.onended = function() {
aud.pause();
};
}
:cookie: 376 | @konsal |http://www.freecodecamp.com/konsal
shado12 sends brownie points to @konsal and @nitinnair89 :sparkles: :thumbsup: :sparkles:
:cookie: 300 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
function convertToF(celsius) {
var fahrenheit;
// Only change code below this line
// Only change code above this line
return fahrenheit;
}
// Change the inputs below to test your code
convertToF(30);
$(this).attr('id');
kenz9932 sends brownie points to @konsal :sparkles: :thumbsup: :sparkles:
:cookie: 377 | @konsal |http://www.freecodecamp.com/konsal
var fahreneit = (celcius*9)/5 + 32
kenz9932 sends brownie points to @konsal :sparkles: :thumbsup: :sparkles:
:warning: kenz9932 already gave konsal points
Hello! I have a quick question. I am here
https://www.freecodecamp.com/challenges/record-collection
and I am wondering what the sense of this line of code is:
var collectionCopy = JSON.parse(JSON.stringify(collection));
Since well, parse
and stringify
are just undoing each others work right there. why not just make a copy without using those two methods? what is the purpose?
konsal sends brownie points to @xsnowpeltx :sparkles: :thumbsup: :sparkles:
:cookie: 300 | @xsnowpeltx |http://www.freecodecamp.com/xsnowpeltx
<a href="https://www.youtube.com/watch?v=S0kX1JeecSQ" target="_blank>
link tag and get rid of that input type submit. u r not submitting anything. u just need a link to an youtube video. then style your <a> tag as you did for the input class="b1 button2"
$('li').addClass("active");
atharvajava sends brownie points to @kurumkan :sparkles: :thumbsup: :sparkles:
:cookie: 361 | @kurumkan |http://www.freecodecamp.com/kurumkan
@j1417 If you use jQuery:$('li').addClass("active");
@j1417 .. answered by @Otto-AA
$('#yourID')...
$('.nav li').click(function() {
$(this).addClass("active");
});
$('li').addClass("active");
$('.nav li').removeClass("active");
to remove all and then add the targeted one after
$('a').on('click', function(e){ $(this).addClass('active')});
will add the class to the current a tag you have clicked
function(e){
to add a console.log(e); call and look into the console for the response
$(this).addClass('active');
mohammadhasham sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 784 | @sorinr |http://www.freecodecamp.com/sorinr
mohammadhasham sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:warning: mohammadhasham already gave sorinr points
j1417 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 785 | @sorinr |http://www.freecodecamp.com/sorinr
mohammadhasham sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:warning: mohammadhasham already gave sorinr points
mohammadhasham sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:warning: mohammadhasham already gave sorinr points
body {
padding: 0;
margin: 0;
background-image: url('your_img_url_here');
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
adriangul123 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 786 | @sorinr |http://www.freecodecamp.com/sorinr
adriangul123 sends brownie points to @alfarhanz :sparkles: :thumbsup: :sparkles:
:cookie: 301 | @alfarhanz |http://www.freecodecamp.com/alfarhanz
like
<nav class="navbar navbar-default navbar-inner">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Adrian Gulbrandsen</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li class="hover"><a href="#about">About</a></li>
<li class="hover"><a href="#portfolio">Portfolio</a></li>
<li class="hover"><a href="#">Contact me</a></li>
</ul>
</div>
</div>
</nav>
adriangul123 sends brownie points to @alfarhanz :sparkles: :thumbsup: :sparkles:
:warning: adriangul123 already gave alfarhanz points
width: 70%;
// or
width: 1000px;
min-width: 100%;
width: 100%; height: 100%
margin: 0 auto;
max-width: 50%
. An typo of me O.o
philipp32 sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:cookie: 318 | @otto-aa |http://www.freecodecamp.com/otto-aa
philipp32 sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:warning: philipp32 already gave otto-aa points
@TasmaniaKrama First load pen over http
i.e remove s
in https
in your codepen URL and just replace your whole js with below code
$('#button').on('click', function(e) {
e.preventDefault();
$.getJSON('http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback='+Math.random(), function(data){
$('#qtitle').text(data[0].title);
$('#qcontent').html(data[0].content);
});
});
And it works instantly without delay which you have before
ferrazoli sends brownie points to @nitinnair89 :sparkles: :thumbsup: :sparkles:
:cookie: 301 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
:cookie: 635 | @vinaypuppal |http://www.freecodecamp.com/vinaypuppal
tasmaniakrama sends brownie points to @vinaypuppal :sparkles: :thumbsup: :sparkles:
:cookie: 446 | @walidashri |http://www.freecodecamp.com/walidashri
vmarron sends brownie points to @walidashri :sparkles: :thumbsup: :sparkles:
&callback=
then browser locally caches you request and when you click button again its same request so nothing will happen since browser already made that request so it does nothing. If we use &callback='+Math.random()
then it will think its different URL(as Math.random() appends some random number at end) so on every button click we get new quote. Thats the reason why i used &callback='+Math.random()
.
could someone review my tribute page and see if anything needs changed, removed, added, etc.
:cookie: 447 | @walidashri |http://www.freecodecamp.com/walidashri
logans1 sends brownie points to @walidashri :sparkles: :thumbsup: :sparkles:
<h1>
cause it's adjacent to the grey box and looks weird.body {
background: #baa684;
text-align: center;
}
width: 1000px;
height: 1200px;
background: #f1efeb;
margin: 25px auto;
border: solid 10px;
h1 {
text-align: center;
font-family:"Times New Roman";
font-size: 24pt;
}
#idname{}