javascript - I cant add class to nth-child -


html:

        <div id="brojac-poteza" style="clear:both;padding-top:40px;padding-left:60px;padding-right:40px">             <div class="round-end darker-back card-choice">1</div>             <div class="darker-back card-choice">2</div>             <div class="darker-back card-choice">3</div>             <div class="darker-back card-choice">4</div>             <div class="darker-back card-choice">6</div>             <div class="darker-back card-choice">5</div>             <div class="darker-back card-choice">7</div>             <div class="darker-back card-choice">8</div>             <div class="darker-back card-choice">9</div>             <div class="darker-back card-choice">10</div>         </div> 

script.js (above code set var g = 1;)

g += 1;  $('#brojac-poteza:nth-child(g)').addclass('round-end'); 

when test says uncaught error: syntax error, unrecognized expression: :nth-child

change to

$('#brojac-poteza:eq('+g+')').addclass('round-end'); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -