skip to Main Content

Jquery – I need to give an element the same class as another element

<div class='topnav' id='myTopnav'> <div class='dropdown'> <button class=' dropbtn'>Adobe ▼</button> <div class='dropdown-content'> <a href='index'>Photoshop</a> </div> </div> </div> <script> jQuery(function($) { var path = window.location.href; $('#myTopnav a').each(function() { if (this.href === path) { $(this).addClass('active'); $(this).parent().parent('first-child').addClass('active'); } }); }); </script> I am not…

VIEW QUESTION

Jquery – .NET Core Ajax Call to Controller

This is my Index.cshtml @{ ViewData["Title"] = "Home Page"; } <div class="text-center"> <h1 class="display-4">Welcome to SyncFusion</h1> <input type="text" name="username" id="username" value=''> <button type="button" id="btnMe">Click me!</button> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> $(document).ready(function () { $("#btnMe").click(function () { $.ajax({ type: "POST", url: "HOME/Users",…

VIEW QUESTION

jQuery match element by id and class

I need to catch some elements in a form. The elements look like this: <div id="wpforms-22603-field_17-container" class="wpforms-field wpforms-field-likert_scale" data-field-id="17"> <div id="wpforms-22603-field_18-container" class="wpforms-field wpforms-field-likert_scale" data-field-id="18"> <div id="wpforms-22603-field_19-container" class="wpforms-field wpforms-field-likert_scale" data-field-id="19"> The variable part is the number after -field_ and of course…

VIEW QUESTION
Back To Top
Search