How do I take variables in javascript?How do JavaScript closures work?How do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?Which equals operator (== vs ===) should be used in JavaScript comparisons?How do I redirect to another webpage?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?How do I return the response from an asynchronous call?
How do I tell the reader that my character is autistic in Fantasy?
cannot execute script while its permission is 'x'
What's the easiest way for a whole party to be able to communicate with a creature that doesn't know Common?
Does the Pi 4 resolve the Ethernet+USB bottleneck issue of past versions?
How can a valley surrounded by mountains be fertile and rainy?
Who are these Discworld wizards from this picture?
How can I add two boxes in minipages side by side?
Why is Japan trying to have a better relationship with Iran?
Is this homebrew Half-Phoenix race balanced?
What could a reptilian race tell by candling their eggs?
Conjugate る-ending verbs into negative form
Pshat of what did Korach take?
How did researchers find articles before the Internet and the computer era?
What is the purpose of putting a capacitor on the primary side of a step-down transformer?
What's the safest way to inform a new user of their password on an invite-only website?
Does any Greek word have a geminate consonant after a long vowel?
Choosing my first bike
How exactly is a normal force exerted, at the molecular level?
Why do we use a cylinder as a Gaussian surface for infinitely long charged wire?
What was the impact of Fischer vs. Spassky 1972 on the relationship between the USA and the Soviet Union?
Boolean Difference with Offset?
How to securely dispose of a smartphone?
Is it bad to describe a character long after their introduction?
Computing the sum of an infinite series as a variant of a geometric series
How do I take variables in javascript?
How do JavaScript closures work?How do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?Which equals operator (== vs ===) should be used in JavaScript comparisons?How do I redirect to another webpage?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?How do I return the response from an asynchronous call?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I made an AJAX request so that when I select drop down the results will be out. I am confused. The problem is that only a table is displayed. How come the data comes from the variable $grade
(calculation of grade), the variable $value
(calculation of total value)?
I try to get the element. $grade
instead it is undefined
<script type="text/javascript">
$(document).ready(function()
$('#kategori').on('change', function(e)
var id = e.target.value;
$.get('/khs/khs_semester/' + id, function(data)
console.log(id);
console.log(data);
$('#khs').empty();
$.each(data, function(index, element)
$('#khs').append("<tr><td>" + element.kode_mk + "</td><td>" + element.nama_mk + "</td>" + "<td>" + element.semester + "</td><td>" + element.jml_sks + "</td><td>" + element.$grade + "</td></tr>");
);
);
);
);
</script>
<table class="table table-bordered">
<thead>
<tr>
<th width="100">KODE MK</th>
<th width="350">NAMA MK</th>
<th width="50">SEMESTER</th>
<th width="50">SKS</th>
<th width="50">GRADE</th>
</tr>
</thead>
<tbody id="khs">
@foreach($mahasiswa as $row)
@php
$nilai = hitung_nilai($row->id);
$grade = hitung_grade($nilai);
$mutu = hitung_mutu($grade);
@endphp
<tr>
<td> $row->kode_mk </td>
<td> $row->nama_mk </td>
<td> $row->semester </td>
<td> $row->jml_sks</td>
<td> $grade </td>
<td> $mutu*$row->jml_sks </td>
</tr>
@php
$totalSKS=$totalSKS+$row->jml_sks;
$totalMutu = $totalMutu+$mutu*$row->jml_sks;
@endphp
@endforeach
</tbody>
</table>
javascript ajax laravel
add a comment |
I made an AJAX request so that when I select drop down the results will be out. I am confused. The problem is that only a table is displayed. How come the data comes from the variable $grade
(calculation of grade), the variable $value
(calculation of total value)?
I try to get the element. $grade
instead it is undefined
<script type="text/javascript">
$(document).ready(function()
$('#kategori').on('change', function(e)
var id = e.target.value;
$.get('/khs/khs_semester/' + id, function(data)
console.log(id);
console.log(data);
$('#khs').empty();
$.each(data, function(index, element)
$('#khs').append("<tr><td>" + element.kode_mk + "</td><td>" + element.nama_mk + "</td>" + "<td>" + element.semester + "</td><td>" + element.jml_sks + "</td><td>" + element.$grade + "</td></tr>");
);
);
);
);
</script>
<table class="table table-bordered">
<thead>
<tr>
<th width="100">KODE MK</th>
<th width="350">NAMA MK</th>
<th width="50">SEMESTER</th>
<th width="50">SKS</th>
<th width="50">GRADE</th>
</tr>
</thead>
<tbody id="khs">
@foreach($mahasiswa as $row)
@php
$nilai = hitung_nilai($row->id);
$grade = hitung_grade($nilai);
$mutu = hitung_mutu($grade);
@endphp
<tr>
<td> $row->kode_mk </td>
<td> $row->nama_mk </td>
<td> $row->semester </td>
<td> $row->jml_sks</td>
<td> $grade </td>
<td> $mutu*$row->jml_sks </td>
</tr>
@php
$totalSKS=$totalSKS+$row->jml_sks;
$totalMutu = $totalMutu+$mutu*$row->jml_sks;
@endphp
@endforeach
</tbody>
</table>
javascript ajax laravel
add a comment |
I made an AJAX request so that when I select drop down the results will be out. I am confused. The problem is that only a table is displayed. How come the data comes from the variable $grade
(calculation of grade), the variable $value
(calculation of total value)?
I try to get the element. $grade
instead it is undefined
<script type="text/javascript">
$(document).ready(function()
$('#kategori').on('change', function(e)
var id = e.target.value;
$.get('/khs/khs_semester/' + id, function(data)
console.log(id);
console.log(data);
$('#khs').empty();
$.each(data, function(index, element)
$('#khs').append("<tr><td>" + element.kode_mk + "</td><td>" + element.nama_mk + "</td>" + "<td>" + element.semester + "</td><td>" + element.jml_sks + "</td><td>" + element.$grade + "</td></tr>");
);
);
);
);
</script>
<table class="table table-bordered">
<thead>
<tr>
<th width="100">KODE MK</th>
<th width="350">NAMA MK</th>
<th width="50">SEMESTER</th>
<th width="50">SKS</th>
<th width="50">GRADE</th>
</tr>
</thead>
<tbody id="khs">
@foreach($mahasiswa as $row)
@php
$nilai = hitung_nilai($row->id);
$grade = hitung_grade($nilai);
$mutu = hitung_mutu($grade);
@endphp
<tr>
<td> $row->kode_mk </td>
<td> $row->nama_mk </td>
<td> $row->semester </td>
<td> $row->jml_sks</td>
<td> $grade </td>
<td> $mutu*$row->jml_sks </td>
</tr>
@php
$totalSKS=$totalSKS+$row->jml_sks;
$totalMutu = $totalMutu+$mutu*$row->jml_sks;
@endphp
@endforeach
</tbody>
</table>
javascript ajax laravel
I made an AJAX request so that when I select drop down the results will be out. I am confused. The problem is that only a table is displayed. How come the data comes from the variable $grade
(calculation of grade), the variable $value
(calculation of total value)?
I try to get the element. $grade
instead it is undefined
<script type="text/javascript">
$(document).ready(function()
$('#kategori').on('change', function(e)
var id = e.target.value;
$.get('/khs/khs_semester/' + id, function(data)
console.log(id);
console.log(data);
$('#khs').empty();
$.each(data, function(index, element)
$('#khs').append("<tr><td>" + element.kode_mk + "</td><td>" + element.nama_mk + "</td>" + "<td>" + element.semester + "</td><td>" + element.jml_sks + "</td><td>" + element.$grade + "</td></tr>");
);
);
);
);
</script>
<table class="table table-bordered">
<thead>
<tr>
<th width="100">KODE MK</th>
<th width="350">NAMA MK</th>
<th width="50">SEMESTER</th>
<th width="50">SKS</th>
<th width="50">GRADE</th>
</tr>
</thead>
<tbody id="khs">
@foreach($mahasiswa as $row)
@php
$nilai = hitung_nilai($row->id);
$grade = hitung_grade($nilai);
$mutu = hitung_mutu($grade);
@endphp
<tr>
<td> $row->kode_mk </td>
<td> $row->nama_mk </td>
<td> $row->semester </td>
<td> $row->jml_sks</td>
<td> $grade </td>
<td> $mutu*$row->jml_sks </td>
</tr>
@php
$totalSKS=$totalSKS+$row->jml_sks;
$totalMutu = $totalMutu+$mutu*$row->jml_sks;
@endphp
@endforeach
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function()
$('#kategori').on('change', function(e)
var id = e.target.value;
$.get('/khs/khs_semester/' + id, function(data)
console.log(id);
console.log(data);
$('#khs').empty();
$.each(data, function(index, element)
$('#khs').append("<tr><td>" + element.kode_mk + "</td><td>" + element.nama_mk + "</td>" + "<td>" + element.semester + "</td><td>" + element.jml_sks + "</td><td>" + element.$grade + "</td></tr>");
);
);
);
);
</script>
<table class="table table-bordered">
<thead>
<tr>
<th width="100">KODE MK</th>
<th width="350">NAMA MK</th>
<th width="50">SEMESTER</th>
<th width="50">SKS</th>
<th width="50">GRADE</th>
</tr>
</thead>
<tbody id="khs">
@foreach($mahasiswa as $row)
@php
$nilai = hitung_nilai($row->id);
$grade = hitung_grade($nilai);
$mutu = hitung_mutu($grade);
@endphp
<tr>
<td> $row->kode_mk </td>
<td> $row->nama_mk </td>
<td> $row->semester </td>
<td> $row->jml_sks</td>
<td> $grade </td>
<td> $mutu*$row->jml_sks </td>
</tr>
@php
$totalSKS=$totalSKS+$row->jml_sks;
$totalMutu = $totalMutu+$mutu*$row->jml_sks;
@endphp
@endforeach
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function()
$('#kategori').on('change', function(e)
var id = e.target.value;
$.get('/khs/khs_semester/' + id, function(data)
console.log(id);
console.log(data);
$('#khs').empty();
$.each(data, function(index, element)
$('#khs').append("<tr><td>" + element.kode_mk + "</td><td>" + element.nama_mk + "</td>" + "<td>" + element.semester + "</td><td>" + element.jml_sks + "</td><td>" + element.$grade + "</td></tr>");
);
);
);
);
</script>
<table class="table table-bordered">
<thead>
<tr>
<th width="100">KODE MK</th>
<th width="350">NAMA MK</th>
<th width="50">SEMESTER</th>
<th width="50">SKS</th>
<th width="50">GRADE</th>
</tr>
</thead>
<tbody id="khs">
@foreach($mahasiswa as $row)
@php
$nilai = hitung_nilai($row->id);
$grade = hitung_grade($nilai);
$mutu = hitung_mutu($grade);
@endphp
<tr>
<td> $row->kode_mk </td>
<td> $row->nama_mk </td>
<td> $row->semester </td>
<td> $row->jml_sks</td>
<td> $grade </td>
<td> $mutu*$row->jml_sks </td>
</tr>
@php
$totalSKS=$totalSKS+$row->jml_sks;
$totalMutu = $totalMutu+$mutu*$row->jml_sks;
@endphp
@endforeach
</tbody>
</table>
javascript ajax laravel
javascript ajax laravel
edited Mar 25 at 15:01
Derk Jan Speelman
3,2401 gold badge13 silver badges30 bronze badges
3,2401 gold badge13 silver badges30 bronze badges
asked Mar 25 at 13:26
Khaiz Badaru TammamKhaiz Badaru Tammam
231 silver badge8 bronze badges
231 silver badge8 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
What might help you is to identify each row by an ID, it could be an ID in the <tr id="KM003">
or in the specific TD of the grade, like <td id="KM003Grade">
so you could get the grade by the students code like: var Name = $('#IDused').innerHTML;
If you use by the ROW approach, you could use a class in each child TD to identify the attribute, for example:
<tr id="km003">
<td class="kode"> $row->kode_mk </td>
<td class="nama"> $row->nama_mk </td>
<td class="semester"> $row->semester </td>
<td class="jml_sks"> $row->jml_sks</td>
<td class="grade"> $grade </td>
</tr>
and then you could get the value by var grade = $("#km003 .grade").innerHTML;
sorry, where is it put? i don't understand ajax
– Khaiz Badaru Tammam
Mar 25 at 13:52
@KhaizBadaruTammam this is JQuery basically, what you want to do is to identify each row by an ID, it could be an ID in the<tr id="KM003">
or in the specific TD of the grade, like<td id="KM003Grade">
so you could get the grade by the students code...
– MonneratRJ
Mar 25 at 13:58
If you use by the ROW, like the first example, you could use a class in each child TD to identify the attribute, for example:<tr id="km003">
` <td class="kode"> $row->kode_mk </td>` ` <td class="nama"> $row->nama_mk </td>` ` <td class="semester"> $row->semester </td>` ` <td class="jml_sks"> $row->jml_sks</td>` ` <td class="grade"> $grade </td><br />`</tr>
– MonneratRJ
Mar 25 at 14:02
im having trouble to indent the code here, but basically after you use an id to the row, you could acess by JQuery using$('#km003 .grade).innerHTML;
– MonneratRJ
Mar 25 at 14:11
a nice and fast way to find out if the code is ok, if it works, is using the google devtools,Ctrl+Shift+I
to open and you can type on console
– MonneratRJ
Mar 25 at 14:13
|
show 3 more comments
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55338887%2fhow-do-i-take-variables-in-javascript%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
What might help you is to identify each row by an ID, it could be an ID in the <tr id="KM003">
or in the specific TD of the grade, like <td id="KM003Grade">
so you could get the grade by the students code like: var Name = $('#IDused').innerHTML;
If you use by the ROW approach, you could use a class in each child TD to identify the attribute, for example:
<tr id="km003">
<td class="kode"> $row->kode_mk </td>
<td class="nama"> $row->nama_mk </td>
<td class="semester"> $row->semester </td>
<td class="jml_sks"> $row->jml_sks</td>
<td class="grade"> $grade </td>
</tr>
and then you could get the value by var grade = $("#km003 .grade").innerHTML;
sorry, where is it put? i don't understand ajax
– Khaiz Badaru Tammam
Mar 25 at 13:52
@KhaizBadaruTammam this is JQuery basically, what you want to do is to identify each row by an ID, it could be an ID in the<tr id="KM003">
or in the specific TD of the grade, like<td id="KM003Grade">
so you could get the grade by the students code...
– MonneratRJ
Mar 25 at 13:58
If you use by the ROW, like the first example, you could use a class in each child TD to identify the attribute, for example:<tr id="km003">
` <td class="kode"> $row->kode_mk </td>` ` <td class="nama"> $row->nama_mk </td>` ` <td class="semester"> $row->semester </td>` ` <td class="jml_sks"> $row->jml_sks</td>` ` <td class="grade"> $grade </td><br />`</tr>
– MonneratRJ
Mar 25 at 14:02
im having trouble to indent the code here, but basically after you use an id to the row, you could acess by JQuery using$('#km003 .grade).innerHTML;
– MonneratRJ
Mar 25 at 14:11
a nice and fast way to find out if the code is ok, if it works, is using the google devtools,Ctrl+Shift+I
to open and you can type on console
– MonneratRJ
Mar 25 at 14:13
|
show 3 more comments
What might help you is to identify each row by an ID, it could be an ID in the <tr id="KM003">
or in the specific TD of the grade, like <td id="KM003Grade">
so you could get the grade by the students code like: var Name = $('#IDused').innerHTML;
If you use by the ROW approach, you could use a class in each child TD to identify the attribute, for example:
<tr id="km003">
<td class="kode"> $row->kode_mk </td>
<td class="nama"> $row->nama_mk </td>
<td class="semester"> $row->semester </td>
<td class="jml_sks"> $row->jml_sks</td>
<td class="grade"> $grade </td>
</tr>
and then you could get the value by var grade = $("#km003 .grade").innerHTML;
sorry, where is it put? i don't understand ajax
– Khaiz Badaru Tammam
Mar 25 at 13:52
@KhaizBadaruTammam this is JQuery basically, what you want to do is to identify each row by an ID, it could be an ID in the<tr id="KM003">
or in the specific TD of the grade, like<td id="KM003Grade">
so you could get the grade by the students code...
– MonneratRJ
Mar 25 at 13:58
If you use by the ROW, like the first example, you could use a class in each child TD to identify the attribute, for example:<tr id="km003">
` <td class="kode"> $row->kode_mk </td>` ` <td class="nama"> $row->nama_mk </td>` ` <td class="semester"> $row->semester </td>` ` <td class="jml_sks"> $row->jml_sks</td>` ` <td class="grade"> $grade </td><br />`</tr>
– MonneratRJ
Mar 25 at 14:02
im having trouble to indent the code here, but basically after you use an id to the row, you could acess by JQuery using$('#km003 .grade).innerHTML;
– MonneratRJ
Mar 25 at 14:11
a nice and fast way to find out if the code is ok, if it works, is using the google devtools,Ctrl+Shift+I
to open and you can type on console
– MonneratRJ
Mar 25 at 14:13
|
show 3 more comments
What might help you is to identify each row by an ID, it could be an ID in the <tr id="KM003">
or in the specific TD of the grade, like <td id="KM003Grade">
so you could get the grade by the students code like: var Name = $('#IDused').innerHTML;
If you use by the ROW approach, you could use a class in each child TD to identify the attribute, for example:
<tr id="km003">
<td class="kode"> $row->kode_mk </td>
<td class="nama"> $row->nama_mk </td>
<td class="semester"> $row->semester </td>
<td class="jml_sks"> $row->jml_sks</td>
<td class="grade"> $grade </td>
</tr>
and then you could get the value by var grade = $("#km003 .grade").innerHTML;
What might help you is to identify each row by an ID, it could be an ID in the <tr id="KM003">
or in the specific TD of the grade, like <td id="KM003Grade">
so you could get the grade by the students code like: var Name = $('#IDused').innerHTML;
If you use by the ROW approach, you could use a class in each child TD to identify the attribute, for example:
<tr id="km003">
<td class="kode"> $row->kode_mk </td>
<td class="nama"> $row->nama_mk </td>
<td class="semester"> $row->semester </td>
<td class="jml_sks"> $row->jml_sks</td>
<td class="grade"> $grade </td>
</tr>
and then you could get the value by var grade = $("#km003 .grade").innerHTML;
edited Mar 25 at 14:56
answered Mar 25 at 13:30
MonneratRJMonneratRJ
1349 bronze badges
1349 bronze badges
sorry, where is it put? i don't understand ajax
– Khaiz Badaru Tammam
Mar 25 at 13:52
@KhaizBadaruTammam this is JQuery basically, what you want to do is to identify each row by an ID, it could be an ID in the<tr id="KM003">
or in the specific TD of the grade, like<td id="KM003Grade">
so you could get the grade by the students code...
– MonneratRJ
Mar 25 at 13:58
If you use by the ROW, like the first example, you could use a class in each child TD to identify the attribute, for example:<tr id="km003">
` <td class="kode"> $row->kode_mk </td>` ` <td class="nama"> $row->nama_mk </td>` ` <td class="semester"> $row->semester </td>` ` <td class="jml_sks"> $row->jml_sks</td>` ` <td class="grade"> $grade </td><br />`</tr>
– MonneratRJ
Mar 25 at 14:02
im having trouble to indent the code here, but basically after you use an id to the row, you could acess by JQuery using$('#km003 .grade).innerHTML;
– MonneratRJ
Mar 25 at 14:11
a nice and fast way to find out if the code is ok, if it works, is using the google devtools,Ctrl+Shift+I
to open and you can type on console
– MonneratRJ
Mar 25 at 14:13
|
show 3 more comments
sorry, where is it put? i don't understand ajax
– Khaiz Badaru Tammam
Mar 25 at 13:52
@KhaizBadaruTammam this is JQuery basically, what you want to do is to identify each row by an ID, it could be an ID in the<tr id="KM003">
or in the specific TD of the grade, like<td id="KM003Grade">
so you could get the grade by the students code...
– MonneratRJ
Mar 25 at 13:58
If you use by the ROW, like the first example, you could use a class in each child TD to identify the attribute, for example:<tr id="km003">
` <td class="kode"> $row->kode_mk </td>` ` <td class="nama"> $row->nama_mk </td>` ` <td class="semester"> $row->semester </td>` ` <td class="jml_sks"> $row->jml_sks</td>` ` <td class="grade"> $grade </td><br />`</tr>
– MonneratRJ
Mar 25 at 14:02
im having trouble to indent the code here, but basically after you use an id to the row, you could acess by JQuery using$('#km003 .grade).innerHTML;
– MonneratRJ
Mar 25 at 14:11
a nice and fast way to find out if the code is ok, if it works, is using the google devtools,Ctrl+Shift+I
to open and you can type on console
– MonneratRJ
Mar 25 at 14:13
sorry, where is it put? i don't understand ajax
– Khaiz Badaru Tammam
Mar 25 at 13:52
sorry, where is it put? i don't understand ajax
– Khaiz Badaru Tammam
Mar 25 at 13:52
@KhaizBadaruTammam this is JQuery basically, what you want to do is to identify each row by an ID, it could be an ID in the
<tr id="KM003">
or in the specific TD of the grade, like <td id="KM003Grade">
so you could get the grade by the students code...– MonneratRJ
Mar 25 at 13:58
@KhaizBadaruTammam this is JQuery basically, what you want to do is to identify each row by an ID, it could be an ID in the
<tr id="KM003">
or in the specific TD of the grade, like <td id="KM003Grade">
so you could get the grade by the students code...– MonneratRJ
Mar 25 at 13:58
If you use by the ROW, like the first example, you could use a class in each child TD to identify the attribute, for example:
<tr id="km003">
` <td class="kode"> $row->kode_mk </td>` ` <td class="nama"> $row->nama_mk </td>` ` <td class="semester"> $row->semester </td>` ` <td class="jml_sks"> $row->jml_sks</td>` ` <td class="grade"> $grade </td><br />` </tr>
– MonneratRJ
Mar 25 at 14:02
If you use by the ROW, like the first example, you could use a class in each child TD to identify the attribute, for example:
<tr id="km003">
` <td class="kode"> $row->kode_mk </td>` ` <td class="nama"> $row->nama_mk </td>` ` <td class="semester"> $row->semester </td>` ` <td class="jml_sks"> $row->jml_sks</td>` ` <td class="grade"> $grade </td><br />` </tr>
– MonneratRJ
Mar 25 at 14:02
im having trouble to indent the code here, but basically after you use an id to the row, you could acess by JQuery using
$('#km003 .grade).innerHTML;
– MonneratRJ
Mar 25 at 14:11
im having trouble to indent the code here, but basically after you use an id to the row, you could acess by JQuery using
$('#km003 .grade).innerHTML;
– MonneratRJ
Mar 25 at 14:11
a nice and fast way to find out if the code is ok, if it works, is using the google devtools,
Ctrl+Shift+I
to open and you can type on console– MonneratRJ
Mar 25 at 14:13
a nice and fast way to find out if the code is ok, if it works, is using the google devtools,
Ctrl+Shift+I
to open and you can type on console– MonneratRJ
Mar 25 at 14:13
|
show 3 more comments
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55338887%2fhow-do-i-take-variables-in-javascript%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown