<html>
<head>
<meta name="description" content="حساب قيمة عيار الذهب في عينة ذهب">
<style>
body{
direction:rtl;
}
.result{
font-size:1.2em;
}
</style>
<meta charset="utf-8">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<title>JS Bin</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>
حساب وزن ذهب مدموغ مقدرا بعيار قياسي
</h2>
<form class="form">
<div class="form-group">
<label for"w">الوزن الغعلي</label>
<input type="number" class="form-control" placeholder="ex:30.120g" id="w" onchange="iclear()" />
</div>
<div class="form-group">
<label for"c">الدمغة/التركيز</label>
<input type="number" class="form-control" placeholder="ex:870" id="c" onchange="iclear()" />
</div>
<div class="form-group">
<label for"s">العيار</label>
<select id="s" onchange="iclear()" class="form-control">
<option value="1000">عيار24</option>
<option selected value="875">عيار21</option>
<option value="750">عيار18</option>
<option value="583">عيار14</option>
</select>
</div>
<a onclick="calc()" class="btn btn-primary" href="#">حساب الوزن مقدرا بالعيار</a>
</form>
<br>
<div style="display:none" class="alert alert-success result" id="result"></div>
</div>
</div>
</div>
</body>
</html>
function calc()
{
var str = 'العينة تحتوي على ذهب مقدرا ب*s* يساوي *r* جرام';
var result = document.getElementById('result');
var w = document.getElementById('w').value
var c = document.getElementById('c').value
var st = document.getElementById('s')
var s = st.value;
var sTxt = st.options[st.selectedIndex].innerHTML;
var x = (w*c)/s
result.innerHTML = str.replace('*r*',Number(x.toFixed(3))).replace('*s*',sTxt);
result.style.display='block';
}
function iclear()
{
var result = document.getElementById('result');
result.innerHTML = '';
result.style.display='none';
}
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |