Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8233327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:05:31+00:00 2026-06-07T18:05:31+00:00

Is there a way to accessing html elements under a particular class name in

  • 0

Is there a way to accessing html elements under a particular class name in JavaScript?

Hers is what I have so far:

Partial:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Student.Models.vwStudent>>" %>

<table>
        <tr>
            <th>
                Student ID
            </th>           
            <th>
                Past Due Amount
            </th>
            <th>
                Past Due Days
            </th>            
        </tr>

        <% if (Model != null)
           foreach (var item in Model) { %>

        <tr>
            <td class="StudentInv">
                <%=Html.TextBox("StudentID",item.StudentID) %>
            </td>

            <td class="StudentInv">
                <%=Html.TextBox("PastDueAmount",item.PastDueAmount) %>
            </td>
            <td class="StudentInv">
                <%=Html.TextBox("PastDueDays",item.PastDueDays) %>
            </td>            
        </tr>

    <% } %>

Master:

<div>
<% using(Html.BeginForm("SaveStudentInvoice", "StudentInvoice")) %>
<% { %>
<div>
<% Html.RenderPartial("DisplayStudentInvoiceList"); %>
</div>
<% } %>
<br/>
<input type="button" id="Submit" name="Submit" value="Submit" />
</div>

JavaScript:

$('#Submit').click(function () {

    var link = '/StudentInvoice/SaveStudentInvoice';
    $.ajax({
        type: 'POST',
        url: link,
        data: { SaveStudent: $(".StudentInv").val()
        },
        dataType: 'json',
        success: function (result) {
            alert("Success")
        },
        error: function (result) {
            alert("Failed")
        }
    });
});

Controller:

[HttpPost()]
public ActionResult SaveStudentInvoice(string SaveStudent)
{
    /// Parse SaveStudent String and rerform some Action

        return View();

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:05:32+00:00Added an answer on June 7, 2026 at 6:05 pm

    Your jQuery should be

    $(".StudentInv input")
    

    Selecting the input object inside a node with the class of StudentInv.

    UPDATE Working With Lists

    Note that because your query returns multiple nodes, $.val() only returns the first item’s value. You can iterate through each of them by doing http://jsfiddle.net/Qs4JC/2/

    var values = [];
    $(".StudentInv input").each(function(){
       values.push($(this).val());
    });
    // values is populated here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have problem with libhid . i found that there 2 way 4 accessing
Is there no magic python way of accessing the instance of the class that
Is there any way of accessing both a result set and output parameters from
Is there any way to find out or store which app is accessing an
Is there way to copy a file into Plone with WebDAV and have Plone
is there way how to get name ov event from Lambda expression like with
Is there way to mute an audio stream or at least control the volume?
many webpages use onload JavaScript to manipulate their DOM. Is there a way I
I have the following HTML and CSS: <div class=content> <div class=leftbg></div> <div class=innercontent><p>Some content
I have a HTML file in C:\Users\myusername\AppData\Roaming\myapp\file.html . I am accessing the file through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.