cf()
更新日: 2018-09-04
cf()
// 使い方
chance.cf()イタリアの社会保障番号(Codice Fiscale)をランダムに返します。
chance.cf();
=> 'BRSMRT87S49A988X'オプションで、任意の情報を指定します。
first: 名last: 姓gender: 性別birthday: 生年月日city: 出生地(イタリアのISTATコード)
chance.cf({first: 'Sergio', last: 'Leone'});
=> 'LNESRG93P28F067V'
chance.cf({first: 'Sophia', last: 'Loren', gender: 'Female', birthday: new Date(1934,8,20), city: 'h501'});
=> 'LRNSPH34P60H501G'デモ
ボタンを押すと、イタリアの社会保障番号をランダムに表示します。
結果:
JavaScript
var button = document.getElementById('get-result');
button.addEventListener('click', function() {
var chance = new Chance();
document.getElementById('result').innerHTML = chance.cf();
}, false);
HTML
<button id="get-result">結果表示</button>
<div>
<span>結果:</span>
<span id="result"></span>
</div>© 2015 Victor Quinn Released under the MIT license
このコンテンツはVictor Quinn(victorquinn)によるChanceドキュメントを翻訳/改変したものです。